diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java index 6e167535ba..cfa70b8e80 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java @@ -115,6 +115,7 @@ import org.springframework.util.StringUtils; * @author Christian Dupuis * @author Matt Benson * @see ShellProperties + * @deprecated as of 1.5 */ @Configuration @ConditionalOnClass(PluginLifeCycle.class) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java index d0de4dcc91..fe02b23f5c 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java @@ -38,6 +38,7 @@ import org.springframework.util.StringUtils; * @author Phillip Webb * @author EddĂș MelĂ©ndez * @author Stephane Nicoll + * @deprecated as of 1.5 */ @ConfigurationProperties(prefix = ShellProperties.SHELL_PREFIX, ignoreUnknownFields = true) @Deprecated diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpoint.java index 4e8f9fc6c0..02af56b5bb 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AutoConfigurationReportEndpoint.java @@ -89,14 +89,13 @@ public class AutoConfigurationReportEndpoint extends AbstractEndpoint { add(this.negativeMatches, entry.getKey(), entry.getValue()); } } - this.parent = report.getParent() != null ? new Report(report.getParent()) - : null; + boolean hasParent = report.getParent() != null; + this.parent = (hasParent ? new Report(report.getParent()) : null); } private void add(Map map, String source, ConditionAndOutcomes conditionAndOutcomes) { String name = ClassUtils.getShortName(source); - map.put(name, new MessageAndConditions(conditionAndOutcomes)); } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AbstractDatabaseInitializer.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AbstractDatabaseInitializer.java index 6e00a9f1f5..085e9693e3 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AbstractDatabaseInitializer.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AbstractDatabaseInitializer.java @@ -42,7 +42,8 @@ public abstract class AbstractDatabaseInitializer { private final ResourceLoader resourceLoader; - protected AbstractDatabaseInitializer(DataSource dataSource, ResourceLoader resourceLoader) { + protected AbstractDatabaseInitializer(DataSource dataSource, + ResourceLoader resourceLoader) { Assert.notNull(dataSource, "DataSource must not be null"); Assert.notNull(resourceLoader, "ResourceLoader must not be null"); this.dataSource = dataSource; @@ -51,17 +52,18 @@ public abstract class AbstractDatabaseInitializer { @PostConstruct protected void initialize() { - if (isEnabled()) { - ResourceDatabasePopulator populator = new ResourceDatabasePopulator(); - String schemaLocation = getSchemaLocation(); - if (schemaLocation.contains(PLATFORM_PLACEHOLDER)) { - String platform = getDatabaseName(); - schemaLocation = schemaLocation.replace(PLATFORM_PLACEHOLDER, platform); - } - populator.addScript(this.resourceLoader.getResource(schemaLocation)); - populator.setContinueOnError(true); - DatabasePopulatorUtils.execute(populator, this.dataSource); + if (!isEnabled()) { + return; + } + ResourceDatabasePopulator populator = new ResourceDatabasePopulator(); + String schemaLocation = getSchemaLocation(); + if (schemaLocation.contains(PLATFORM_PLACEHOLDER)) { + String platform = getDatabaseName(); + schemaLocation = schemaLocation.replace(PLATFORM_PLACEHOLDER, platform); } + populator.addScript(this.resourceLoader.getResource(schemaLocation)); + populator.setContinueOnError(true); + DatabasePopulatorUtils.execute(populator, this.dataSource); } protected abstract boolean isEnabled(); @@ -70,11 +72,10 @@ public abstract class AbstractDatabaseInitializer { protected String getDatabaseName() { try { - String databaseProductName = JdbcUtils.extractDatabaseMetaData( - this.dataSource, "getDatabaseProductName").toString(); - databaseProductName = JdbcUtils.commonDatabaseName(databaseProductName); - DatabaseDriver databaseDriver = DatabaseDriver.fromProductName( - databaseProductName); + String productName = JdbcUtils.commonDatabaseName(JdbcUtils + .extractDatabaseMetaData(this.dataSource, "getDatabaseProductName") + .toString()); + DatabaseDriver databaseDriver = DatabaseDriver.fromProductName(productName); if (databaseDriver == DatabaseDriver.UNKNOWN) { throw new IllegalStateException("Unable to detect database type"); } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchDatabaseInitializer.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchDatabaseInitializer.java index 96d47adb28..20785e2222 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchDatabaseInitializer.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchDatabaseInitializer.java @@ -32,8 +32,8 @@ public class BatchDatabaseInitializer extends AbstractDatabaseInitializer { private final BatchProperties properties; - public BatchDatabaseInitializer(DataSource dataSource, - ResourceLoader resourceLoader, BatchProperties properties) { + public BatchDatabaseInitializer(DataSource dataSource, ResourceLoader resourceLoader, + BatchProperties properties) { super(dataSource, resourceLoader); Assert.notNull(properties, "BatchProperties must not be null"); this.properties = properties; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestProperties.java index a4d6579fa0..7bfcdabe85 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestProperties.java @@ -65,8 +65,7 @@ public class RepositoryRestProperties { /** * Strategy to use to determine which repositories get exposed. */ - private RepositoryDetectionStrategies detectionStrategy = - RepositoryDetectionStrategies.DEFAULT; + private RepositoryDetectionStrategies detectionStrategy = RepositoryDetectionStrategies.DEFAULT; /** * Content type to use as a default when none is specified. diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBuilder.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBuilder.java index d5e4b688ce..d3036fa46e 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBuilder.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBuilder.java @@ -44,7 +44,7 @@ public class DataSourceBuilder { private static final String[] DATA_SOURCE_TYPE_NAMES = new String[] { "org.apache.tomcat.jdbc.pool.DataSource", "com.zaxxer.hikari.HikariDataSource", - "org.apache.commons.dbcp.BasicDataSource", //deprecated + "org.apache.commons.dbcp.BasicDataSource", // deprecated "org.apache.commons.dbcp2.BasicDataSource" }; private Class type; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfiguration.java index d4252939b1..03d08fb056 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfiguration.java @@ -41,7 +41,7 @@ import org.springframework.jms.support.destination.DestinationResolver; * @author Stephane Nicoll */ @Configuration -@ConditionalOnClass({Message.class, JmsTemplate.class}) +@ConditionalOnClass({ Message.class, JmsTemplate.class }) @ConditionalOnBean(ConnectionFactory.class) @EnableConfigurationProperties(JmsProperties.class) @Import(JmsAnnotationDrivenConfiguration.class) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java index eb5e7d6684..2dea5b54fd 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsProperties.java @@ -135,8 +135,8 @@ public class JmsProperties { public static class Template { /** - * Default destination to use on send/receive operations that do not - * have a destination parameter. + * Default destination to use on send/receive operations that do not have a + * destination parameter. */ private String defaultDestination; @@ -156,16 +156,14 @@ public class JmsProperties { private Integer priority; /** - * Time-to-live of a message when sending in milliseconds. Enable - * QoS when set. + * Time-to-live of a message when sending in milliseconds. Enable QoS when set. */ private Long timeToLive; /** - * Enable explicit QoS when sending a message. When enabled, the - * delivery mode, priority and time-to-live properties will be - * used when sending a message. QoS is automatically enabled when - * at least one of those settings is customized. + * Enable explicit QoS when sending a message. When enabled, the delivery mode, + * priority and time-to-live properties will be used when sending a message. QoS + * is automatically enabled when at least one of those settings is customized. */ private Boolean qosEnabled; @@ -291,8 +289,8 @@ public class JmsProperties { NON_PERSISTENT(1), /* - * Instructs the JMS provider to log the message to stable storage as part of - * the client's send operation. + * Instructs the JMS provider to log the message to stable storage as part of the + * client's send operation. */ PERSISTENT(2); diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index e55a4a77ae..9dbca47cd1 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -658,15 +658,15 @@ public class ServerProperties private Charset uriEncoding; /** - * Maximum number of connections that the server will accept and process - * at any given time. Once the limit has been reached, the operating system - * may still accept connections based on the "acceptCount" property. + * Maximum number of connections that the server will accept and process at any + * given time. Once the limit has been reached, the operating system may still + * accept connections based on the "acceptCount" property. */ private int maxConnections = 0; /** - * Maximum queue length for incoming connection requests when all possible - * request processing threads are in use. + * Maximum queue length for incoming connection requests when all possible request + * processing threads are in use. */ private int acceptCount = 0; @@ -827,34 +827,37 @@ public class ServerProperties public void customize(Connector connector) { ProtocolHandler handler = connector.getProtocolHandler(); if (handler instanceof AbstractProtocol) { - AbstractProtocol protocol = (AbstractProtocol) handler; + AbstractProtocol protocol = (AbstractProtocol) handler; protocol.setBacklog(Tomcat.this.acceptCount); } } + }); } - private void customizeMaxConnections(TomcatEmbeddedServletContainerFactory factory) { + private void customizeMaxConnections( + TomcatEmbeddedServletContainerFactory factory) { factory.addConnectorCustomizers(new TomcatConnectorCustomizer() { @Override public void customize(Connector connector) { ProtocolHandler handler = connector.getProtocolHandler(); if (handler instanceof AbstractProtocol) { - AbstractProtocol protocol = (AbstractProtocol) handler; + AbstractProtocol protocol = (AbstractProtocol) handler; protocol.setMaxConnections(Tomcat.this.maxConnections); } } + }); } private void customizeConnectionTimeout( TomcatEmbeddedServletContainerFactory factory, int connectionTimeout) { for (Connector connector : factory.getAdditionalTomcatConnectors()) { - if (connector.getProtocolHandler() instanceof AbstractProtocol) { - AbstractProtocol handler = (AbstractProtocol) connector - .getProtocolHandler(); - handler.setConnectionTimeout(connectionTimeout); + ProtocolHandler handler = connector.getProtocolHandler(); + if (handler instanceof AbstractProtocol) { + AbstractProtocol protocol = (AbstractProtocol) handler; + protocol.setConnectionTimeout(connectionTimeout); } } } @@ -1108,6 +1111,7 @@ public class ServerProperties JettyEmbeddedServletContainerFactory factory, final int connectionTimeout) { factory.addServerCustomizers(new JettyServerCustomizer() { + @Override public void customize(Server server) { for (org.eclipse.jetty.server.Connector connector : server @@ -1118,6 +1122,7 @@ public class ServerProperties } } } + }); } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.java index faf46b1815..bd9b15fd7b 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.java @@ -19,7 +19,6 @@ package org.springframework.boot.autoconfigure.data.cassandra; import java.util.Set; import com.datastax.driver.core.Session; - import org.junit.After; import org.junit.Test; diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzerTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzerTests.java index 5e988e6259..cb4c16942a 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzerTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzerTests.java @@ -191,7 +191,8 @@ public class NoSuchBeanDefinitionFailureAnalyzerTests { private void assertClassDisabled(FailureAnalysis analysis, String description, String methodName) { - String expected = String.format("Bean method '%s' not loaded because", methodName); + String expected = String.format("Bean method '%s' not loaded because", + methodName); assertThat(analysis.getDescription()).contains(expected); assertThat(analysis.getDescription()).contains(description); } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfigurationTests.java index 5842663f25..bf35dee8b3 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfigurationTests.java @@ -141,8 +141,8 @@ public class DataSourceAutoConfigurationTests { @Deprecated public void commonsDbcpIsFallback() throws Exception { org.apache.commons.dbcp.BasicDataSource dataSource = autoConfigureDataSource( - org.apache.commons.dbcp.BasicDataSource.class, - "org.apache.tomcat", "com.zaxxer.hikari"); + org.apache.commons.dbcp.BasicDataSource.class, "org.apache.tomcat", + "com.zaxxer.hikari"); assertThat(dataSource.getUrl()).isEqualTo("jdbc:hsqldb:mem:testdb"); } @@ -150,8 +150,8 @@ public class DataSourceAutoConfigurationTests { @Deprecated public void commonsDbcpValidatesConnectionByDefault() { org.apache.commons.dbcp.BasicDataSource dataSource = autoConfigureDataSource( - org.apache.commons.dbcp.BasicDataSource.class, - "org.apache.tomcat", "com.zaxxer.hikari"); + org.apache.commons.dbcp.BasicDataSource.class, "org.apache.tomcat", + "com.zaxxer.hikari"); assertThat(dataSource.getTestOnBorrow()).isTrue(); assertThat(dataSource.getValidationQuery()) .isEqualTo(DatabaseDriver.HSQLDB.getValidationQuery()); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java index 1e81850a7f..522de557bd 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java @@ -259,8 +259,7 @@ public class JmsAutoConfigurationTests { "spring.jms.template.default-destination=testQueue", "spring.jms.template.delivery-delay=500", "spring.jms.template.delivery-mode=non-persistent", - "spring.jms.template.priority=6", - "spring.jms.template.time-to-live=6000", + "spring.jms.template.priority=6", "spring.jms.template.time-to-live=6000", "spring.jms.template.receive-timeout=2000"); JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class); assertThat(jmsTemplate.getMessageConverter()) diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java index dd276071fc..67f6bbc8e4 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java @@ -444,9 +444,9 @@ public class ServerPropertiesTests { TomcatEmbeddedServletContainerFactory container = new TomcatEmbeddedServletContainerFactory(); this.properties.customize(container); - TomcatEmbeddedServletContainer embeddedContainer = - (TomcatEmbeddedServletContainer) container.getEmbeddedServletContainer(); - assertThat(((AbstractProtocol) embeddedContainer.getTomcat().getConnector() + TomcatEmbeddedServletContainer embeddedContainer = (TomcatEmbeddedServletContainer) container + .getEmbeddedServletContainer(); + assertThat(((AbstractProtocol) embeddedContainer.getTomcat().getConnector() .getProtocolHandler()).getBacklog()).isEqualTo(10); } @@ -458,9 +458,9 @@ public class ServerPropertiesTests { TomcatEmbeddedServletContainerFactory container = new TomcatEmbeddedServletContainerFactory(); this.properties.customize(container); - TomcatEmbeddedServletContainer embeddedContainer = - (TomcatEmbeddedServletContainer) container.getEmbeddedServletContainer(); - assertThat(((AbstractProtocol) embeddedContainer.getTomcat().getConnector() + TomcatEmbeddedServletContainer embeddedContainer = (TomcatEmbeddedServletContainer) container + .getEmbeddedServletContainer(); + assertThat(((AbstractProtocol) embeddedContainer.getTomcat().getConnector() .getProtocolHandler()).getMaxConnections()).isEqualTo(5); } diff --git a/spring-boot-cli/src/it/java/org/springframework/boot/cli/WarCommandIT.java b/spring-boot-cli/src/it/java/org/springframework/boot/cli/WarCommandIT.java index 6d5856df01..150d24751d 100644 --- a/spring-boot-cli/src/it/java/org/springframework/boot/cli/WarCommandIT.java +++ b/spring-boot-cli/src/it/java/org/springframework/boot/cli/WarCommandIT.java @@ -56,8 +56,7 @@ public class WarCommandIT { assertThat(invocation.getOutput()).contains("Tomcat started"); assertThat(invocation.getOutput()) .contains("/WEB-INF/lib-provided/tomcat-embed-core"); - assertThat(invocation.getOutput()) - .contains("WEB-INF/classes!/root.properties"); + assertThat(invocation.getOutput()).contains("WEB-INF/classes!/root.properties"); process.destroy(); } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/archive/ArchiveCommand.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/archive/ArchiveCommand.java index 45e2b5bd33..412b0916f5 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/archive/ArchiveCommand.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/archive/ArchiveCommand.java @@ -289,10 +289,9 @@ abstract class ArchiveCommand extends OptionParsingCommand { return libraries; } - protected void writeClasspathEntry(JarWriter writer, - MatchedResource entry) throws IOException { - writer.writeEntry(entry.getName(), - new FileInputStream(entry.getFile())); + protected void writeClasspathEntry(JarWriter writer, MatchedResource entry) + throws IOException { + writer.writeEntry(entry.getName(), new FileInputStream(entry.getFile())); } protected abstract LibraryScope getLibraryScope(File file); diff --git a/spring-boot-samples/spring-boot-sample-hibernate52/src/test/java/sample/hibernate52/service/CityRepositoryIntegrationTests.java b/spring-boot-samples/spring-boot-sample-hibernate52/src/test/java/sample/hibernate52/service/CityRepositoryIntegrationTests.java index 796232f058..d5231c64b6 100644 --- a/spring-boot-samples/spring-boot-sample-hibernate52/src/test/java/sample/hibernate52/service/CityRepositoryIntegrationTests.java +++ b/spring-boot-samples/spring-boot-sample-hibernate52/src/test/java/sample/hibernate52/service/CityRepositoryIntegrationTests.java @@ -18,7 +18,6 @@ package sample.hibernate52.service; import org.junit.Test; import org.junit.runner.RunWith; import sample.hibernate52.domain.City; -import sample.hibernate52.service.CityRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; diff --git a/spring-boot-samples/spring-boot-sample-hibernate52/src/test/java/sample/hibernate52/service/HotelRepositoryIntegrationTests.java b/spring-boot-samples/spring-boot-sample-hibernate52/src/test/java/sample/hibernate52/service/HotelRepositoryIntegrationTests.java index e94b106ffc..065f5d0533 100644 --- a/spring-boot-samples/spring-boot-sample-hibernate52/src/test/java/sample/hibernate52/service/HotelRepositoryIntegrationTests.java +++ b/spring-boot-samples/spring-boot-sample-hibernate52/src/test/java/sample/hibernate52/service/HotelRepositoryIntegrationTests.java @@ -24,8 +24,6 @@ import sample.hibernate52.domain.Hotel; import sample.hibernate52.domain.HotelSummary; import sample.hibernate52.domain.Rating; import sample.hibernate52.domain.RatingCount; -import sample.hibernate52.service.CityRepository; -import sample.hibernate52.service.HotelRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; diff --git a/spring-boot-samples/spring-boot-sample-web-thymeleaf3/src/test/java/sample/web/thymeleaf3/MessageControllerWebTests.java b/spring-boot-samples/spring-boot-sample-web-thymeleaf3/src/test/java/sample/web/thymeleaf3/MessageControllerWebTests.java index 373e2079b1..9e6e5a9004 100644 --- a/spring-boot-samples/spring-boot-sample-web-thymeleaf3/src/test/java/sample/web/thymeleaf3/MessageControllerWebTests.java +++ b/spring-boot-samples/spring-boot-sample-web-thymeleaf3/src/test/java/sample/web/thymeleaf3/MessageControllerWebTests.java @@ -23,7 +23,6 @@ import org.hamcrest.TypeSafeMatcher; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import sample.web.thymeleaf3.SampleWebThymeleaf3Application; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; diff --git a/spring-boot-starters/spring-boot-starter-remote-shell/src/main/java/org/springframework/boot/starter/remote/shell/RemoteShellStarterDeprecatedWarningAutoConfiguration.java b/spring-boot-starters/spring-boot-starter-remote-shell/src/main/java/org/springframework/boot/starter/remote/shell/RemoteShellStarterDeprecatedWarningAutoConfiguration.java index acb14e8702..b851c65264 100644 --- a/spring-boot-starters/spring-boot-starter-remote-shell/src/main/java/org/springframework/boot/starter/remote/shell/RemoteShellStarterDeprecatedWarningAutoConfiguration.java +++ b/spring-boot-starters/spring-boot-starter-remote-shell/src/main/java/org/springframework/boot/starter/remote/shell/RemoteShellStarterDeprecatedWarningAutoConfiguration.java @@ -29,7 +29,7 @@ import org.springframework.context.annotation.Configuration; * the starter. * * @author Stephane Nicoll - * @since 1.4.0 + * @since 1.5.0 */ @Configuration @Deprecated @@ -40,10 +40,8 @@ public class RemoteShellStarterDeprecatedWarningAutoConfiguration { @PostConstruct public void logWarning() { - logger.warn("spring-boot-starter-remote-shell is deprecated since Spring Boot " + - "1.5 and will be removed in Spring Boot 2.0"); + logger.warn("spring-boot-starter-remote-shell is deprecated since Spring Boot " + + "1.5 and will be removed in Spring Boot 2.0"); } } - - diff --git a/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java index 9a2f65f877..7518a0adc5 100644 --- a/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java +++ b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java @@ -42,7 +42,6 @@ import org.springframework.boot.configurationsample.lombok.LombokInnerClassPrope import org.springframework.boot.configurationsample.lombok.LombokSimpleDataProperties; import org.springframework.boot.configurationsample.lombok.LombokSimpleProperties; import org.springframework.boot.configurationsample.lombok.SimpleLombokPojo; -import org.springframework.boot.configurationsample.method.DeprecatedClassMethodConfig; import org.springframework.boot.configurationsample.method.DeprecatedMethodConfig; import org.springframework.boot.configurationsample.method.EmptyTypeMethodConfig; import org.springframework.boot.configurationsample.method.InvalidMethodConfig; @@ -290,8 +289,7 @@ public class ConfigurationMetadataAnnotationProcessorTests { public void deprecatedMethodConfig() throws Exception { Class type = DeprecatedMethodConfig.class; ConfigurationMetadata metadata = compile(type); - assertThat(metadata) - .has(Metadata.withGroup("foo").fromSource(type)); + assertThat(metadata).has(Metadata.withGroup("foo").fromSource(type)); assertThat(metadata).has(Metadata.withProperty("foo.name", String.class) .fromSource(DeprecatedMethodConfig.Foo.class) .withDeprecation(null, null)); @@ -301,16 +299,18 @@ public class ConfigurationMetadataAnnotationProcessorTests { } @Test + @SuppressWarnings("deprecation") public void deprecatedMethodConfigOnClass() throws Exception { - Class type = DeprecatedClassMethodConfig.class; + Class type = org.springframework.boot.configurationsample.method.DeprecatedClassMethodConfig.class; ConfigurationMetadata metadata = compile(type); - assertThat(metadata) - .has(Metadata.withGroup("foo").fromSource(type)); + assertThat(metadata).has(Metadata.withGroup("foo").fromSource(type)); assertThat(metadata).has(Metadata.withProperty("foo.name", String.class) - .fromSource(DeprecatedClassMethodConfig.Foo.class) + .fromSource( + org.springframework.boot.configurationsample.method.DeprecatedClassMethodConfig.Foo.class) .withDeprecation(null, null)); assertThat(metadata).has(Metadata.withProperty("foo.flag", Boolean.class) - .fromSource(DeprecatedClassMethodConfig.Foo.class) + .fromSource( + org.springframework.boot.configurationsample.method.DeprecatedClassMethodConfig.Foo.class) .withDeprecation(null, null)); } diff --git a/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/method/DeprecatedClassMethodConfig.java b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/method/DeprecatedClassMethodConfig.java index 99d9494bea..4b3a4a197e 100644 --- a/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/method/DeprecatedClassMethodConfig.java +++ b/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/method/DeprecatedClassMethodConfig.java @@ -52,6 +52,7 @@ public class DeprecatedClassMethodConfig { public void setFlag(boolean flag) { this.flag = flag; } + } } diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/RunProcess.java b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/RunProcess.java index ebf81c9141..6cc20a4e44 100644 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/RunProcess.java +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/RunProcess.java @@ -51,23 +51,23 @@ public class RunProcess { private volatile long endTime; /** - * Creates new {@link RunProcess} instance for the specified command - * and working directory. - * @param workingDirectory the working directory of the child process or {@code null} - * to run in the working directory of the current Java process + * Creates new {@link RunProcess} instance for the specified command. * @param command the program to execute and it's arguments */ - public RunProcess(File workingDirectory, String... command) { - this.workingDirectory = workingDirectory; - this.command = command; + public RunProcess(String... command) { + this(null, command); } /** - * Creates new {@link RunProcess} instance for the specified command. + * Creates new {@link RunProcess} instance for the specified working directory and + * command. + * @param workingDirectory the working directory of the child process or {@code null} + * to run in the working directory of the current Java process * @param command the program to execute and it's arguments */ - public RunProcess(String... command) { - this(null, command); + public RunProcess(File workingDirectory, String... command) { + this.workingDirectory = workingDirectory; + this.command = command; } public int run(boolean waitForProcess, String... args) throws IOException { diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java index 0cf076b589..b22b1b7e57 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java +++ b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java @@ -149,8 +149,8 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo { /** * Flag to indicate if the run processes should be forked. {@code fork} is - * automatically enabled if an agent, jvmArguments or working directory are - * specified, or if devtools is present. + * automatically enabled if an agent, jvmArguments or working directory are specified, + * or if devtools is present. * @since 1.2 */ @Parameter(property = "fork") @@ -206,7 +206,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo { } private boolean hasWorkingDirectorySet() { - return (this.workingDirectory != null); + return this.workingDirectory != null; } private void findAgent() { diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunMojo.java b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunMojo.java index 55843def71..cc211bc85b 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunMojo.java +++ b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunMojo.java @@ -64,9 +64,11 @@ public class RunMojo extends AbstractRunMojo { } @Override - protected void runWithForkedJvm(File workingDirectory, List args) throws MojoExecutionException { + protected void runWithForkedJvm(File workingDirectory, List args) + throws MojoExecutionException { try { - RunProcess runProcess = new RunProcess(workingDirectory, new JavaExecutable().toString()); + RunProcess runProcess = new RunProcess(workingDirectory, + new JavaExecutable().toString()); Runtime.getRuntime() .addShutdownHook(new Thread(new RunProcessKiller(runProcess))); int exitCode = runProcess.run(true, args.toArray(new String[args.size()])); diff --git a/spring-boot/src/main/java/org/springframework/boot/SpringBootConfiguration.java b/spring-boot/src/main/java/org/springframework/boot/SpringBootConfiguration.java index 86d6119285..f0d00118ea 100644 --- a/spring-boot/src/main/java/org/springframework/boot/SpringBootConfiguration.java +++ b/spring-boot/src/main/java/org/springframework/boot/SpringBootConfiguration.java @@ -30,9 +30,9 @@ import org.springframework.context.annotation.Configuration; * standard {@code @Configuration} annotation so that configuration can be found * automatically (for example in tests). *

- * Application should only ever include one - * {@code @SpringBootConfiguration} and most idiomatic Spring Boot applications - * will inherit it from {@code @SpringBootApplication}. + * Application should only ever include one {@code @SpringBootConfiguration} and + * most idiomatic Spring Boot applications will inherit it from + * {@code @SpringBootApplication}. * * @author Phillip Webb * @since 1.4.0