From efcbb32788379e48fbae0a88b46e956b6eecd491 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Mon, 2 Jun 2014 10:55:04 +0100 Subject: [PATCH] Remove some compiler warnings --- .../data/rest/RepositoryRestMvcAutoConfiguration.java | 1 - .../batch/JobLauncherCommandLineRunnerTests.java | 2 +- .../boot/cli/command/jar/JarCommand.java | 10 ++++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestMvcAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestMvcAutoConfiguration.java index 1ee21dca8a..e284a1c034 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestMvcAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/rest/RepositoryRestMvcAutoConfiguration.java @@ -20,7 +20,6 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.autoconfigure.data.JpaRepositoriesAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunnerTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunnerTests.java index 3328c5a48f..7752766a07 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunnerTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunnerTests.java @@ -152,7 +152,7 @@ public class JobLauncherCommandLineRunnerTests { this.transactionManager); public BatchConfiguration() throws Exception { - this.jobRepository = this.jobRepositoryFactory.getJobRepository(); + this.jobRepository = this.jobRepositoryFactory.getObject(); } public void clear() { diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/jar/JarCommand.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/jar/JarCommand.java index ebd5b9b79a..4b5b744140 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/jar/JarCommand.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/jar/JarCommand.java @@ -59,7 +59,6 @@ import org.springframework.boot.loader.tools.Layouts; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.util.Assert; -import org.springframework.util.ClassUtils; /** * {@link Command} to create a self-contained executable jar file from a CLI application @@ -211,10 +210,12 @@ public class JarCommand extends OptionParsingCommand { private void addCliClasses(JarWriter writer) throws IOException { addClass(writer, PackagedSpringApplicationLauncher.class); - Resource[] resources = new PathMatchingResourcePatternResolver().getResources("org/springframework/boot/groovy/**"); + Resource[] resources = new PathMatchingResourcePatternResolver() + .getResources("org/springframework/boot/groovy/**"); for (Resource resource : resources) { String url = resource.getURL().toString(); - addResource(writer, resource, url.substring(url.indexOf("org/springframework/boot/groovy/"))); + addResource(writer, resource, + url.substring(url.indexOf("org/springframework/boot/groovy/"))); } } @@ -224,7 +225,8 @@ public class JarCommand extends OptionParsingCommand { writer.writeEntry(name, stream); } - private void addResource(JarWriter writer, Resource resource, String name) throws IOException { + private void addResource(JarWriter writer, Resource resource, String name) + throws IOException { InputStream stream = resource.getInputStream(); writer.writeEntry(name, stream); }