From ed9735361e902b118143a82126526cc08d9e5700 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 5 Feb 2014 22:37:41 -0800 Subject: [PATCH] Apply source cleanup and formatting --- .../AutoConfigurationReportEndpoint.java | 2 +- .../export/MetricCopyExporterTests.java | 3 ++- .../metrics/export/RichGaugeExporterTests.java | 3 ++- .../writer/DefaultCounterServiceTests.java | 3 ++- .../AutoConfigurationPackages.java | 4 ++-- .../condition/SpringBootCondition.java | 4 ++-- .../AutoConfigurationReportTests.java | 2 -- ...igurationReportLoggingInitializerTests.java | 1 - .../boot/cli/command/NoArgumentsException.java | 1 - .../cli/command/options/OptionHandler.java | 4 ++-- .../command/CommandRunnerIntegrationTests.java | 1 - ...pendencyCoordinatesTransformationTests.java | 1 - ...enciesArtifactCoordinatesResolverTests.java | 1 - .../mongo/SampleMongoApplicationTests.java | 4 ++-- .../secure/SampleSecureApplicationTests.java | 11 ++++++----- .../secure/SampleSecureApplicationTests.java | 1 - .../boot/gradle/SpringBootPlugin.java | 13 ++++++++----- .../gradle/SpringBootResolutionStrategy.java | 3 +-- .../boot/gradle/task/ProjectLibraries.java | 15 +++++++++------ .../boot/gradle/task/Repackage.java | 15 ++++++++++----- .../boot/gradle/task/RunApp.java | 18 ++++++++++-------- .../boot/config/YamlPropertySourceLoader.java | 2 +- .../VcapApplicationListenerTests.java | 1 - .../ConfigFileApplicationListenerTests.java | 3 --- ...xtIdApplicationContextInitializerTests.java | 1 - .../FileEncodingApplicationListenerTests.java | 1 - ...gateApplicationContextInitializerTests.java | 1 - ...onmentDelegateApplicationListenerTests.java | 1 - .../boot/json/JacksonParserTests.java | 3 --- .../boot/json/SimpleJsonParserTests.java | 2 -- .../boot/json/YamlJsonParserTests.java | 3 --- .../LoggingApplicationListenerTests.java | 2 -- .../boot/yaml/ArrayDocumentMatcherTests.java | 1 - .../boot/yaml/YamlMapFactoryBeanTests.java | 1 - .../boot/yaml/YamlProcessorTests.java | 1 - .../yaml/YamlPropertiesFactoryBeanTests.java | 1 - 36 files changed, 60 insertions(+), 74 deletions(-) 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 ec8fae06e9..e707a4cf94 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 @@ -22,9 +22,9 @@ import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.actuate.endpoint.AutoConfigurationReportEndpoint.Report; import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport; -import org.springframework.boot.autoconfigure.condition.ConditionOutcome; import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport.ConditionAndOutcome; import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport.ConditionAndOutcomes; +import org.springframework.boot.autoconfigure.condition.ConditionOutcome; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Condition; import org.springframework.util.ClassUtils; diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/MetricCopyExporterTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/MetricCopyExporterTests.java index accd5d60ca..9ad012f145 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/MetricCopyExporterTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/MetricCopyExporterTests.java @@ -31,7 +31,8 @@ public class MetricCopyExporterTests { private final InMemoryMetricRepository writer = new InMemoryMetricRepository(); private final InMemoryMetricRepository reader = new InMemoryMetricRepository(); - private final MetricCopyExporter exporter = new MetricCopyExporter(this.reader, this.writer); + private final MetricCopyExporter exporter = new MetricCopyExporter(this.reader, + this.writer); @Test public void export() { diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/RichGaugeExporterTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/RichGaugeExporterTests.java index 4735af10e7..d972c3ae1b 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/RichGaugeExporterTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/RichGaugeExporterTests.java @@ -31,7 +31,8 @@ public class RichGaugeExporterTests { private final InMemoryRichGaugeRepository reader = new InMemoryRichGaugeRepository(); private final InMemoryMetricRepository writer = new InMemoryMetricRepository(); - private final RichGaugeExporter exporter = new RichGaugeExporter(this.reader, this.writer); + private final RichGaugeExporter exporter = new RichGaugeExporter(this.reader, + this.writer); @Test public void prefixedMetricsCopied() { diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/writer/DefaultCounterServiceTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/writer/DefaultCounterServiceTests.java index 3000d387a0..ed522c12e3 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/writer/DefaultCounterServiceTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/writer/DefaultCounterServiceTests.java @@ -30,7 +30,8 @@ public class DefaultCounterServiceTests { private final MetricWriter repository = mock(MetricWriter.class); - private final DefaultCounterService service = new DefaultCounterService(this.repository); + private final DefaultCounterService service = new DefaultCounterService( + this.repository); @Test public void incrementPrependsCounter() { diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java index c9a95a8d1a..ce7bbbf8f0 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java @@ -21,7 +21,7 @@ import java.util.List; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.NoSuchBeanDefinitionException; -import org.springframework.beans.factory.support.AbstractBeanDefinition; +import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.GenericBeanDefinition; import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; @@ -65,7 +65,7 @@ public abstract class AutoConfigurationPackages { beanDefinition.setBeanClass(BasePackage.class); beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(0, packageName); - beanDefinition.setRole(AbstractBeanDefinition.ROLE_INFRASTRUCTURE); + beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); registry.registerBeanDefinition(BEAN, beanDefinition); } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/SpringBootCondition.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/SpringBootCondition.java index 8fc53b480d..2de6f8ab7c 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/SpringBootCondition.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/SpringBootCondition.java @@ -76,8 +76,8 @@ public abstract class SpringBootCondition implements Condition { return message; } - private void recordEvaluation(ConditionContext context, - String classOrMethodName, ConditionOutcome outcome) { + private void recordEvaluation(ConditionContext context, String classOrMethodName, + ConditionOutcome outcome) { if (context.getBeanFactory() != null) { ConditionEvaluationReport.get(context.getBeanFactory()) .recordConditionEvaluation(classOrMethodName, this, outcome); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/AutoConfigurationReportTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/AutoConfigurationReportTests.java index 36928badac..2fe20a020a 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/AutoConfigurationReportTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/AutoConfigurationReportTests.java @@ -29,8 +29,6 @@ import org.mockito.MockitoAnnotations; import org.springframework.beans.factory.annotation.Configurable; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory; -import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport; -import org.springframework.boot.autoconfigure.condition.ConditionOutcome; import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport.ConditionAndOutcome; import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport.ConditionAndOutcomes; import org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration; diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/AutoConfigurationReportLoggingInitializerTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/AutoConfigurationReportLoggingInitializerTests.java index 289f363dab..4a782132bb 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/AutoConfigurationReportLoggingInitializerTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/AutoConfigurationReportLoggingInitializerTests.java @@ -32,7 +32,6 @@ import org.mockito.stubbing.Answer; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport; -import org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer; import org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration; import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration; import org.springframework.boot.event.ApplicationFailedEvent; diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/NoArgumentsException.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/NoArgumentsException.java index 09a15f0087..d08202f2c7 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/NoArgumentsException.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/NoArgumentsException.java @@ -16,7 +16,6 @@ package org.springframework.boot.cli.command; - /** * Exception used to indicate that no arguemnts were specified. * diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java index b334c41561..ca3d9dbbe0 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java @@ -31,8 +31,6 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; -import org.springframework.boot.cli.command.OptionParsingCommand; - import joptsimple.BuiltinHelpFormatter; import joptsimple.HelpFormatter; import joptsimple.OptionDescriptor; @@ -40,6 +38,8 @@ import joptsimple.OptionParser; import joptsimple.OptionSet; import joptsimple.OptionSpecBuilder; +import org.springframework.boot.cli.command.OptionParsingCommand; + /** * Delegate used by {@link OptionParsingCommand} to parse options and run the command. * diff --git a/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerIntegrationTests.java b/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerIntegrationTests.java index 0706bb1c51..b635d027c2 100644 --- a/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerIntegrationTests.java +++ b/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerIntegrationTests.java @@ -18,7 +18,6 @@ package org.springframework.boot.cli.command; import org.junit.Rule; import org.junit.Test; -import org.springframework.boot.cli.command.CommandRunner; import org.springframework.boot.cli.command.run.RunCommand; import org.springframework.boot.cli.util.OutputCapture; diff --git a/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/ResolveDependencyCoordinatesTransformationTests.java b/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/ResolveDependencyCoordinatesTransformationTests.java index 4ed9b2ca7c..d2cd26791c 100644 --- a/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/ResolveDependencyCoordinatesTransformationTests.java +++ b/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/ResolveDependencyCoordinatesTransformationTests.java @@ -42,7 +42,6 @@ import org.codehaus.groovy.control.io.ReaderSource; import org.codehaus.groovy.transform.ASTTransformation; import org.junit.Before; import org.junit.Test; -import org.springframework.boot.cli.compiler.ResolveDependencyCoordinatesTransformation; import org.springframework.boot.cli.compiler.dependencies.ArtifactCoordinatesResolver; import static org.junit.Assert.assertEquals; diff --git a/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/dependencies/ManagedDependenciesArtifactCoordinatesResolverTests.java b/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/dependencies/ManagedDependenciesArtifactCoordinatesResolverTests.java index ed9915af0d..7dc472355a 100644 --- a/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/dependencies/ManagedDependenciesArtifactCoordinatesResolverTests.java +++ b/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/dependencies/ManagedDependenciesArtifactCoordinatesResolverTests.java @@ -18,7 +18,6 @@ package org.springframework.boot.cli.compiler.dependencies; import org.junit.Before; import org.junit.Test; -import org.springframework.boot.cli.compiler.dependencies.ManagedDependenciesArtifactCoordinatesResolver; import org.springframework.boot.dependency.tools.Dependency; import org.springframework.boot.dependency.tools.ManagedDependencies; diff --git a/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java b/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java index 0b69ef053e..00a3f5afa4 100644 --- a/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java @@ -16,8 +16,6 @@ package sample.data.mongo; -import static org.junit.Assert.assertTrue; - import java.net.ConnectException; import org.junit.Rule; @@ -25,6 +23,8 @@ import org.junit.Test; import org.springframework.boot.test.OutputCapture; import org.springframework.core.NestedCheckedException; +import static org.junit.Assert.assertTrue; + /** * Tests for {@link SampleMongoApplication}. * diff --git a/spring-boot-samples/spring-boot-sample-secure/src/test/java/sample/secure/SampleSecureApplicationTests.java b/spring-boot-samples/spring-boot-sample-secure/src/test/java/sample/secure/SampleSecureApplicationTests.java index 142bb128c3..9e8335938d 100644 --- a/spring-boot-samples/spring-boot-sample-secure/src/test/java/sample/secure/SampleSecureApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-secure/src/test/java/sample/secure/SampleSecureApplicationTests.java @@ -16,8 +16,6 @@ package sample.secure; -import static org.junit.Assert.assertEquals; - import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -37,6 +35,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import sample.secure.SampleSecureApplicationTests.TestConfiguration; +import static org.junit.Assert.assertEquals; + /** * Basic integration tests for demo application. * @@ -57,9 +57,10 @@ public class SampleSecureApplicationTests { @Before public void init() { - AuthenticationManager authenticationManager = context.getBean(AuthenticationManager.class); - authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken( - "user", "password")); + AuthenticationManager authenticationManager = context + .getBean(AuthenticationManager.class); + authentication = authenticationManager + .authenticate(new UsernamePasswordAuthenticationToken("user", "password")); } @After diff --git a/spring-boot-samples/spring-boot-sample-web-secure/src/test/java/sample/ui/secure/SampleSecureApplicationTests.java b/spring-boot-samples/spring-boot-sample-web-secure/src/test/java/sample/ui/secure/SampleSecureApplicationTests.java index 86ce7170aa..6abaf7c761 100644 --- a/spring-boot-samples/spring-boot-sample-web-secure/src/test/java/sample/ui/secure/SampleSecureApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-web-secure/src/test/java/sample/ui/secure/SampleSecureApplicationTests.java @@ -38,7 +38,6 @@ import org.springframework.http.client.ClientHttpResponse; import org.springframework.web.client.DefaultResponseErrorHandler; import org.springframework.web.client.RestTemplate; -import sample.ui.secure.SampleSecureApplication; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPlugin.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPlugin.java index 8c90e4034a..d3006d013c 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPlugin.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPlugin.java @@ -29,7 +29,7 @@ import org.springframework.boot.gradle.task.RunApp; /** * Gradle 'Spring Boot' {@link Plugin}. - * + * * @author Phillip Webb * @author Dave Syer */ @@ -59,7 +59,8 @@ public class SpringBootPlugin implements Plugin { private void applyRun(Project project) { addRunAppTask(project); // register BootRepackage so that we can use task foo(type: BootRepackage) {} - project.getExtensions().getExtraProperties().set("BootRepackage", Repackage.class); + project.getExtensions().getExtraProperties() + .set("BootRepackage", Repackage.class); } private void applyResolutionStrategy(Project project) { @@ -80,14 +81,16 @@ public class SpringBootPlugin implements Plugin { + "archives so that they can be executed from the command " + "line using 'java -jar'"); packageTask.setGroup(BasePlugin.BUILD_GROUP); - packageTask.dependsOn(project.getConfigurations().getByName( - Dependency.ARCHIVES_CONFIGURATION).getAllArtifacts().getBuildDependencies()); + packageTask.dependsOn(project.getConfigurations() + .getByName(Dependency.ARCHIVES_CONFIGURATION).getAllArtifacts() + .getBuildDependencies()); return packageTask; } private void addRunAppTask(Project project) { RunApp runJarTask = project.getTasks().create(RUN_APP_TASK_NAME, RunApp.class); - runJarTask.setDescription("Run the project with support for auto-detecting main class and reloading static resources"); + runJarTask.setDescription("Run the project with support for " + + "auto-detecting main class and reloading static resources"); runJarTask.setGroup("Execution"); runJarTask.dependsOn("assemble"); } diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootResolutionStrategy.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootResolutionStrategy.java index c14cb65414..2f92c8b6ed 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootResolutionStrategy.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootResolutionStrategy.java @@ -1,4 +1,3 @@ - package org.springframework.boot.gradle; import org.gradle.api.Action; @@ -11,7 +10,7 @@ import org.springframework.boot.dependency.tools.ManagedDependencies; /** * A resolution strategy to resolve missing version numbers using the * 'spring-boot-dependencies' POM. - * + * * @author Phillip Webb */ public class SpringBootResolutionStrategy { diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java index b49e72bbd5..957ffaca76 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java @@ -64,16 +64,18 @@ class ProjectLibraries implements Libraries { @Override public void doWithLibraries(LibraryCallback callback) throws IOException { - FileCollection custom = this.customConfigurationName != null ? this.project.getConfigurations().findByName( - this.customConfigurationName) - : null; + FileCollection custom = this.customConfigurationName != null ? this.project + .getConfigurations().findByName(this.customConfigurationName) : null; if (custom != null) { libraries(LibraryScope.CUSTOM, custom, callback); - } else { - FileCollection compile = this.project.getConfigurations().getByName("compile"); + } + else { + FileCollection compile = this.project.getConfigurations() + .getByName("compile"); - FileCollection runtime = this.project.getConfigurations().getByName("runtime"); + FileCollection runtime = this.project.getConfigurations() + .getByName("runtime"); runtime = runtime.minus(compile); FileCollection provided = this.project.getConfigurations().findByName( @@ -98,4 +100,5 @@ class ProjectLibraries implements Libraries { } } } + } diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/Repackage.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/Repackage.java index 04e9bb4f39..8423aa7ab6 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/Repackage.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/Repackage.java @@ -60,7 +60,8 @@ public class Repackage extends DefaultTask { } if (this.customConfiguration != null) { libraries.setCustomConfigurationName(this.customConfiguration); - } else if (extension.getCustomConfiguration() != null) { + } + else if (extension.getCustomConfiguration() != null) { libraries.setCustomConfigurationName(extension.getCustomConfiguration()); } project.getTasks().withType(Jar.class, new Action() { @@ -85,12 +86,14 @@ public class Repackage extends DefaultTask { long startTime = System.currentTimeMillis(); try { return super.findMainMethod(source); - } finally { + } + finally { long duration = System.currentTimeMillis() - startTime; if (duration > FIND_WARNING_TIMEOUT) { - getLogger().warn( - "Searching for the main-class is taking some time, " + getLogger() + .warn("Searching for the " + + "main-class is taking some time, " + "consider using setting 'springBoot.mainClass'"); } } @@ -103,7 +106,8 @@ public class Repackage extends DefaultTask { repackager.setBackupSource(extension.isBackupSource()); try { repackager.repackage(libraries); - } catch (IOException ex) { + } + catch (IOException ex) { throw new IllegalStateException(ex.getMessage(), ex); } } @@ -111,4 +115,5 @@ public class Repackage extends DefaultTask { } }); } + } diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunApp.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunApp.java index 1068e8de88..3782e0c72f 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunApp.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/RunApp.java @@ -36,7 +36,7 @@ import org.springframework.boot.loader.tools.MainClassFinder; /** * Run the project from Gradle. - * + * * @author Dave Syer */ public class RunApp extends DefaultTask { @@ -54,15 +54,15 @@ public class RunApp extends DefaultTask { @Override public void execute(SourceSet set) { if (SourceSet.MAIN_SOURCE_SET_NAME.equals(set.getName())) { - main = set; + RunApp.this.main = set; } }; }); final Set allResources = new LinkedHashSet(); - if (main != null) { - SourceDirectorySet resources = main.getResources(); + if (this.main != null) { + SourceDirectorySet resources = this.main.getResources(); allResources.addAll(resources.getSrcDirs()); } @@ -70,13 +70,13 @@ public class RunApp extends DefaultTask { @Override public void execute(JavaExec exec) { - ArrayList files = new ArrayList( - exec.getClasspath().getFiles()); + ArrayList files = new ArrayList(exec.getClasspath() + .getFiles()); files.addAll(0, allResources); getLogger().info("Adding classpath: " + allResources); exec.setClasspath(new SimpleFileCollection(files)); if (exec.getMain() == null) { - final String mainClass = findMainClass(main); + final String mainClass = findMainClass(RunApp.this.main); exec.setMain(mainClass); exec.getConventionMapping().map("main", new Callable() { @@ -84,6 +84,7 @@ public class RunApp extends DefaultTask { public String call() throws Exception { return mainClass; } + }); getLogger().info("Found main: " + mainClass); } @@ -100,7 +101,8 @@ public class RunApp extends DefaultTask { getLogger().info("Looking for main in: " + main.getOutput().getClassesDir()); try { return MainClassFinder.findMainClass(main.getOutput().getClassesDir()); - } catch (IOException ex) { + } + catch (IOException ex) { throw new IllegalStateException("Cannot find main class", ex); } } diff --git a/spring-boot/src/main/java/org/springframework/boot/config/YamlPropertySourceLoader.java b/spring-boot/src/main/java/org/springframework/boot/config/YamlPropertySourceLoader.java index 43bb4eedba..7158497d39 100644 --- a/spring-boot/src/main/java/org/springframework/boot/config/YamlPropertySourceLoader.java +++ b/spring-boot/src/main/java/org/springframework/boot/config/YamlPropertySourceLoader.java @@ -24,9 +24,9 @@ import java.util.Set; import org.springframework.boot.yaml.DefaultProfileDocumentMatcher; import org.springframework.boot.yaml.SpringProfileDocumentMatcher; -import org.springframework.boot.yaml.YamlPropertiesFactoryBean; import org.springframework.boot.yaml.YamlProcessor.DocumentMatcher; import org.springframework.boot.yaml.YamlProcessor.MatchStatus; +import org.springframework.boot.yaml.YamlPropertiesFactoryBean; import org.springframework.core.env.PropertySource; import org.springframework.core.io.Resource; import org.springframework.util.StringUtils; diff --git a/spring-boot/src/test/java/org/springframework/boot/cloudfoundry/VcapApplicationListenerTests.java b/spring-boot/src/test/java/org/springframework/boot/cloudfoundry/VcapApplicationListenerTests.java index 50f90c7d86..79836c06fc 100644 --- a/spring-boot/src/test/java/org/springframework/boot/cloudfoundry/VcapApplicationListenerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/cloudfoundry/VcapApplicationListenerTests.java @@ -18,7 +18,6 @@ package org.springframework.boot.cloudfoundry; import org.junit.Test; import org.springframework.boot.SpringApplication; -import org.springframework.boot.cloudfoundry.VcapApplicationListener; import org.springframework.boot.event.ApplicationEnvironmentPreparedEvent; import org.springframework.boot.test.EnvironmentTestUtils; import org.springframework.context.ConfigurableApplicationContext; diff --git a/spring-boot/src/test/java/org/springframework/boot/config/ConfigFileApplicationListenerTests.java b/spring-boot/src/test/java/org/springframework/boot/config/ConfigFileApplicationListenerTests.java index 4c249a09f4..45e1cc20a9 100644 --- a/spring-boot/src/test/java/org/springframework/boot/config/ConfigFileApplicationListenerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/config/ConfigFileApplicationListenerTests.java @@ -24,9 +24,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.springframework.boot.SpringApplication; -import org.springframework.boot.config.ConfigFileApplicationListener; -import org.springframework.boot.config.PropertySourceLoader; -import org.springframework.boot.config.PropertySourceLoadersFactory; import org.springframework.boot.event.ApplicationEnvironmentPreparedEvent; import org.springframework.boot.test.EnvironmentTestUtils; import org.springframework.context.ConfigurableApplicationContext; diff --git a/spring-boot/src/test/java/org/springframework/boot/context/ContextIdApplicationContextInitializerTests.java b/spring-boot/src/test/java/org/springframework/boot/context/ContextIdApplicationContextInitializerTests.java index 86a4bcc238..43f849fe68 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/ContextIdApplicationContextInitializerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/ContextIdApplicationContextInitializerTests.java @@ -17,7 +17,6 @@ package org.springframework.boot.context; import org.junit.Test; -import org.springframework.boot.context.ContextIdApplicationContextInitializer; import org.springframework.boot.test.EnvironmentTestUtils; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; diff --git a/spring-boot/src/test/java/org/springframework/boot/context/FileEncodingApplicationListenerTests.java b/spring-boot/src/test/java/org/springframework/boot/context/FileEncodingApplicationListenerTests.java index 0535ba99d3..6636bc6387 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/FileEncodingApplicationListenerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/FileEncodingApplicationListenerTests.java @@ -19,7 +19,6 @@ package org.springframework.boot.context; import org.junit.Assume; import org.junit.Test; import org.springframework.boot.SpringApplication; -import org.springframework.boot.context.FileEncodingApplicationListener; import org.springframework.boot.event.ApplicationEnvironmentPreparedEvent; import org.springframework.boot.test.EnvironmentTestUtils; import org.springframework.core.env.ConfigurableEnvironment; diff --git a/spring-boot/src/test/java/org/springframework/boot/context/env/EnvironmentDelegateApplicationContextInitializerTests.java b/spring-boot/src/test/java/org/springframework/boot/context/env/EnvironmentDelegateApplicationContextInitializerTests.java index a59efcc8a5..626de2bd52 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/env/EnvironmentDelegateApplicationContextInitializerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/env/EnvironmentDelegateApplicationContextInitializerTests.java @@ -19,7 +19,6 @@ package org.springframework.boot.context.env; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.springframework.boot.context.env.EnvironmentDelegateApplicationContextInitializer; import org.springframework.boot.test.EnvironmentTestUtils; import org.springframework.context.ApplicationContextException; import org.springframework.context.ApplicationContextInitializer; diff --git a/spring-boot/src/test/java/org/springframework/boot/context/env/EnvironmentDelegateApplicationListenerTests.java b/spring-boot/src/test/java/org/springframework/boot/context/env/EnvironmentDelegateApplicationListenerTests.java index 8b26078fa6..1f9c1d355a 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/env/EnvironmentDelegateApplicationListenerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/env/EnvironmentDelegateApplicationListenerTests.java @@ -21,7 +21,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.springframework.boot.SpringApplication; -import org.springframework.boot.context.env.EnvironmentDelegateApplicationListener; import org.springframework.boot.event.ApplicationEnvironmentPreparedEvent; import org.springframework.boot.test.EnvironmentTestUtils; import org.springframework.context.ApplicationListener; diff --git a/spring-boot/src/test/java/org/springframework/boot/json/JacksonParserTests.java b/spring-boot/src/test/java/org/springframework/boot/json/JacksonParserTests.java index c01603b454..c5dfc24da6 100644 --- a/spring-boot/src/test/java/org/springframework/boot/json/JacksonParserTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/json/JacksonParserTests.java @@ -16,9 +16,6 @@ package org.springframework.boot.json; -import org.springframework.boot.json.JacksonJsonParser; -import org.springframework.boot.json.JsonParser; - /** * Tests for {@link JsonParser}. * diff --git a/spring-boot/src/test/java/org/springframework/boot/json/SimpleJsonParserTests.java b/spring-boot/src/test/java/org/springframework/boot/json/SimpleJsonParserTests.java index c07930f95a..9c8000b4f3 100644 --- a/spring-boot/src/test/java/org/springframework/boot/json/SimpleJsonParserTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/json/SimpleJsonParserTests.java @@ -20,8 +20,6 @@ import java.util.List; import java.util.Map; import org.junit.Test; -import org.springframework.boot.json.JsonParser; -import org.springframework.boot.json.SimpleJsonParser; import static org.junit.Assert.assertEquals; diff --git a/spring-boot/src/test/java/org/springframework/boot/json/YamlJsonParserTests.java b/spring-boot/src/test/java/org/springframework/boot/json/YamlJsonParserTests.java index b89f98faea..559aa4cb22 100644 --- a/spring-boot/src/test/java/org/springframework/boot/json/YamlJsonParserTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/json/YamlJsonParserTests.java @@ -16,9 +16,6 @@ package org.springframework.boot.json; -import org.springframework.boot.json.JsonParser; -import org.springframework.boot.json.YamlJsonParser; - /** * Tests for {@link YamlJsonParser}. * diff --git a/spring-boot/src/test/java/org/springframework/boot/logging/LoggingApplicationListenerTests.java b/spring-boot/src/test/java/org/springframework/boot/logging/LoggingApplicationListenerTests.java index 604743c701..89e9aaac35 100644 --- a/spring-boot/src/test/java/org/springframework/boot/logging/LoggingApplicationListenerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/logging/LoggingApplicationListenerTests.java @@ -30,8 +30,6 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.springframework.boot.SpringApplication; import org.springframework.boot.event.ApplicationStartedEvent; -import org.springframework.boot.logging.LogLevel; -import org.springframework.boot.logging.LoggingApplicationListener; import org.springframework.boot.logging.java.JavaLoggingSystem; import org.springframework.boot.test.EnvironmentTestUtils; import org.springframework.boot.test.OutputCapture; diff --git a/spring-boot/src/test/java/org/springframework/boot/yaml/ArrayDocumentMatcherTests.java b/spring-boot/src/test/java/org/springframework/boot/yaml/ArrayDocumentMatcherTests.java index b783e0b567..0f90bd279b 100644 --- a/spring-boot/src/test/java/org/springframework/boot/yaml/ArrayDocumentMatcherTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/yaml/ArrayDocumentMatcherTests.java @@ -20,7 +20,6 @@ import java.io.IOException; import java.util.Properties; import org.junit.Test; -import org.springframework.boot.yaml.ArrayDocumentMatcher; import org.springframework.boot.yaml.YamlProcessor.MatchStatus; import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.support.PropertiesLoaderUtils; diff --git a/spring-boot/src/test/java/org/springframework/boot/yaml/YamlMapFactoryBeanTests.java b/spring-boot/src/test/java/org/springframework/boot/yaml/YamlMapFactoryBeanTests.java index 90f4085543..d929c09b78 100644 --- a/spring-boot/src/test/java/org/springframework/boot/yaml/YamlMapFactoryBeanTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/yaml/YamlMapFactoryBeanTests.java @@ -22,7 +22,6 @@ import java.util.LinkedHashMap; import java.util.Map; import org.junit.Test; -import org.springframework.boot.yaml.YamlMapFactoryBean; import org.springframework.boot.yaml.YamlProcessor.ResolutionMethod; import org.springframework.core.io.AbstractResource; import org.springframework.core.io.ByteArrayResource; diff --git a/spring-boot/src/test/java/org/springframework/boot/yaml/YamlProcessorTests.java b/spring-boot/src/test/java/org/springframework/boot/yaml/YamlProcessorTests.java index 02c5b65200..a22fe97181 100644 --- a/spring-boot/src/test/java/org/springframework/boot/yaml/YamlProcessorTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/yaml/YamlProcessorTests.java @@ -21,7 +21,6 @@ import java.util.Properties; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.springframework.boot.yaml.YamlProcessor; import org.springframework.boot.yaml.YamlProcessor.MatchCallback; import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.Resource; diff --git a/spring-boot/src/test/java/org/springframework/boot/yaml/YamlPropertiesFactoryBeanTests.java b/spring-boot/src/test/java/org/springframework/boot/yaml/YamlPropertiesFactoryBeanTests.java index 657f2d57f3..2cb6d1b9fb 100644 --- a/spring-boot/src/test/java/org/springframework/boot/yaml/YamlPropertiesFactoryBeanTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/yaml/YamlPropertiesFactoryBeanTests.java @@ -24,7 +24,6 @@ import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.springframework.boot.yaml.YamlPropertiesFactoryBean; import org.springframework.boot.yaml.YamlProcessor.DocumentMatcher; import org.springframework.boot.yaml.YamlProcessor.MatchStatus; import org.springframework.boot.yaml.YamlProcessor.ResolutionMethod;