From efff4a005194298525fe4f8eafc5168a2304611f Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Thu, 19 Nov 2015 21:39:27 +0900 Subject: [PATCH] Polish Closes gh-4554 --- .../PropertyPlaceholderAutoConfigurationTests.java | 2 +- .../web/ServerPropertiesAutoConfigurationTests.java | 4 ++-- .../WebSocketMessagingAutoConfigurationTests.java | 2 +- .../boot/cli/command/init/InitCommand.java | 2 +- .../command/init/ServiceCapabilitiesReportGenerator.java | 2 +- .../boot/cli/command/shell/AnsiString.java | 2 +- .../boot/cli/command/shell/CommandCompleter.java | 4 ++-- .../org/springframework/boot/cli/command/shell/Shell.java | 2 +- .../boot/cli/compiler/DependencyCustomizer.java | 8 ++++---- .../SpringTestCompilerAutoConfiguration.java | 6 +++--- .../org/springframework/boot/groovy/GroovyTemplate.java | 2 +- .../autoconfigure/RemoteDevToolsAutoConfiguration.java | 8 ++++---- .../boot/devtools/filewatch/FileSystemWatcher.java | 2 +- .../boot/devtools/livereload/Connection.java | 2 +- .../boot/devtools/remote/server/UrlHandlerMapper.java | 6 +++--- .../boot/devtools/tunnel/client/HttpTunnelConnection.java | 4 ++-- .../LocalDevToolsAutoConfigurationTests.java | 4 ++-- .../RemoteDevToolsAutoConfigurationTests.java | 4 ++-- .../devtools/tunnel/server/HttpTunnelServerTests.java | 2 +- 19 files changed, 34 insertions(+), 34 deletions(-) diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/PropertyPlaceholderAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/PropertyPlaceholderAutoConfigurationTests.java index 3148f07bc0..777e5b8dd6 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/PropertyPlaceholderAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/PropertyPlaceholderAutoConfigurationTests.java @@ -46,7 +46,7 @@ public class PropertyPlaceholderAutoConfigurationTests { } @Test - public void propertyPlaceholderse() throws Exception { + public void propertyPlaceholders() throws Exception { this.context.register(PropertyPlaceholderAutoConfiguration.class, PlaceholderConfig.class); EnvironmentTestUtils.addEnvironment(this.context, "foo:two"); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfigurationTests.java index 9bfb9b27bb..31f3c3332d 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfigurationTests.java @@ -147,7 +147,7 @@ public class ServerPropertiesAutoConfigurationTests { @Test public void testAccidentalMultipleServerPropertiesBeans() throws Exception { this.context = new AnnotationConfigEmbeddedWebApplicationContext(); - this.context.register(Config.class, MutiServerPropertiesBeanConfig.class, + this.context.register(Config.class, MultiServerPropertiesBeanConfig.class, ServerPropertiesAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class); this.thrown.expect(ApplicationContextException.class); @@ -222,7 +222,7 @@ public class ServerPropertiesAutoConfigurationTests { } @Configuration - protected static class MutiServerPropertiesBeanConfig { + protected static class MultiServerPropertiesBeanConfig { @Bean public ServerProperties serverPropertiesOne() { diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/WebSocketMessagingAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/WebSocketMessagingAutoConfigurationTests.java index f31025a50e..52853053d6 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/WebSocketMessagingAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/WebSocketMessagingAutoConfigurationTests.java @@ -192,7 +192,7 @@ public class WebSocketMessagingAutoConfigurationTests { } @Bean - public TomcatWebSocketContainerCustomizer tomcatCuztomiser() { + public TomcatWebSocketContainerCustomizer tomcatCustomizer() { return new TomcatWebSocketContainerCustomizer(); } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitCommand.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitCommand.java index 538bfa517e..f80e123fa1 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitCommand.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitCommand.java @@ -48,7 +48,7 @@ public class InitCommand extends OptionParsingCommand { public InitCommand(InitOptionHandler handler) { super("init", - "Initialize a new project using Spring " + "Initialzr (start.spring.io)", + "Initialize a new project using Spring " + "Initializr (start.spring.io)", handler); } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ServiceCapabilitiesReportGenerator.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ServiceCapabilitiesReportGenerator.java index 85acae36e1..a619f18c38 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ServiceCapabilitiesReportGenerator.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ServiceCapabilitiesReportGenerator.java @@ -38,7 +38,7 @@ class ServiceCapabilitiesReportGenerator { /** * Creates an instance using the specified {@link InitializrService}. - * @param initializrService the initialzr service + * @param initializrService the initializr service */ ServiceCapabilitiesReportGenerator(InitializrService initializrService) { this.initializrService = initializrService; diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/AnsiString.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/AnsiString.java index 3b15acfcb4..7a7fd90579 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/AnsiString.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/AnsiString.java @@ -21,7 +21,7 @@ import org.fusesource.jansi.Ansi; import org.fusesource.jansi.AnsiRenderer.Code; /** - * Simple utitliy class to build an ANSI string when supported by the {@link Terminal}. + * Simple utility class to build an ANSI string when supported by the {@link Terminal}. * * @author Phillip Webb */ diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/CommandCompleter.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/CommandCompleter.java index 2131dce386..f30ce2f446 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/CommandCompleter.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/CommandCompleter.java @@ -59,10 +59,10 @@ public class CommandCompleter extends StringsCompleter { for (OptionHelp optionHelp : command.getOptionsHelp()) { options.addAll(optionHelp.getOptions()); } - AggregateCompleter arguementCompleters = new AggregateCompleter( + AggregateCompleter argumentCompleters = new AggregateCompleter( new StringsCompleter(options), new FileNameCompleter()); ArgumentCompleter argumentCompleter = new ArgumentCompleter(argumentDelimiter, - arguementCompleters); + argumentCompleters); argumentCompleter.setStrict(false); this.commandCompleters.put(command.getName(), argumentCompleter); } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/Shell.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/Shell.java index 93938f86f6..39d8acaecf 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/Shell.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/Shell.java @@ -175,7 +175,7 @@ public class Shell { } /** - * Final handle an interrup signal (CTRL-C). + * Final handle an interrupt signal (CTRL-C). */ protected void handleSigInt() { if (this.commandRunner.handleSigInt()) { diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/DependencyCustomizer.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/DependencyCustomizer.java index 932a9cc571..cf9921d46c 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/DependencyCustomizer.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/DependencyCustomizer.java @@ -92,9 +92,9 @@ public class DependencyCustomizer { return new DependencyCustomizer(this) { @Override protected boolean canAdd() { - for (String classname : classNames) { + for (String className : classNames) { try { - DependencyCustomizer.this.loader.loadClass(classname); + DependencyCustomizer.this.loader.loadClass(className); } catch (Exception ex) { return true; @@ -115,9 +115,9 @@ public class DependencyCustomizer { return new DependencyCustomizer(this) { @Override protected boolean canAdd() { - for (String classname : classNames) { + for (String className : classNames) { try { - DependencyCustomizer.this.loader.loadClass(classname); + DependencyCustomizer.this.loader.loadClass(className); return false; } catch (Exception ex) { diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringTestCompilerAutoConfiguration.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringTestCompilerAutoConfiguration.java index 4ece278c2a..dc2ea2d64f 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringTestCompilerAutoConfiguration.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringTestCompilerAutoConfiguration.java @@ -56,10 +56,10 @@ public class SpringTestCompilerAutoConfiguration extends CompilerAutoConfigurati GeneratorContext generatorContext, SourceUnit source, ClassNode classNode) throws CompilationFailedException { if (!AstUtils.hasAtLeastOneAnnotation(classNode, "RunWith")) { - AnnotationNode runwith = new AnnotationNode(ClassHelper.make("RunWith")); - runwith.addMember("value", + AnnotationNode runWith = new AnnotationNode(ClassHelper.make("RunWith")); + runWith.addMember("value", new ClassExpression(ClassHelper.make("SpringJUnit4ClassRunner"))); - classNode.addAnnotation(runwith); + classNode.addAnnotation(runWith); } } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java index 3ad152187e..be5aca978b 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/groovy/GroovyTemplate.java @@ -30,7 +30,7 @@ import groovy.text.TemplateEngine; import org.codehaus.groovy.control.CompilationFailedException; /** - * Helpful utilties for working with Groovy {@link Template}s. + * Helpful utilities for working with Groovy {@link Template}s. * * @author Dave Syer */ diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java index 51aaed9dc4..d97d76e218 100644 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfiguration.java @@ -130,8 +130,8 @@ public class RemoteDevToolsAutoConfiguration { } @Bean - @ConditionalOnMissingBean(name = "remoteRestartHanderMapper") - public UrlHandlerMapper remoteRestartHanderMapper(HttpRestartServer server) { + @ConditionalOnMissingBean(name = "remoteRestartHandlerMapper") + public UrlHandlerMapper remoteRestartHandlerMapper(HttpRestartServer server) { String url = (this.serverProperties.getContextPath() == null ? "" : this.serverProperties.getContextPath()) + this.properties.getRemote().getContextPath() + "/restart"; @@ -155,8 +155,8 @@ public class RemoteDevToolsAutoConfiguration { private ServerProperties serverProperties; @Bean - @ConditionalOnMissingBean(name = "remoteDebugHanderMapper") - public UrlHandlerMapper remoteDebugHanderMapper( + @ConditionalOnMissingBean(name = "remoteDebugHandlerMapper") + public UrlHandlerMapper remoteDebugHandlerMapper( @Qualifier("remoteDebugHttpTunnelServer") HttpTunnelServer server) { String url = (this.serverProperties.getContextPath() == null ? "" : this.serverProperties.getContextPath()) diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java index ea0c78e336..07641b246e 100644 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java @@ -240,7 +240,7 @@ public class FileSystemWatcher { /** * Stop monitoring the source folders. - * @param remainingScans the number of scans remaming + * @param remainingScans the number of remaining scans */ synchronized void stopAfter(int remainingScans) { Thread thread = this.watchThread; diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java index c9118d3730..a7aebebe07 100644 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java @@ -113,7 +113,7 @@ class Connection { throw new ConnectionClosedException(); } else if (frame.getType() == Frame.Type.TEXT) { - logger.debug("Recieved LiveReload text frame " + frame); + logger.debug("Received LiveReload text frame " + frame); } else { throw new IOException("Unexpected Frame Type " + frame.getType()); diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapper.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapper.java index a8a7753a72..2b4960c01f 100644 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapper.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapper.java @@ -30,7 +30,7 @@ public class UrlHandlerMapper implements HandlerMapper { private final String requestUri; - private final Handler hander; + private final Handler handler; /** * Create a new {@link UrlHandlerMapper}. @@ -41,13 +41,13 @@ public class UrlHandlerMapper implements HandlerMapper { Assert.hasLength(url, "URL must not be empty"); Assert.isTrue(url.startsWith("/"), "URL must start with '/'"); this.requestUri = url; - this.hander = handler; + this.handler = handler; } @Override public Handler getHandler(ServerHttpRequest request) { if (this.requestUri.equals(request.getURI().getPath())) { - return this.hander; + return this.handler; } return null; } diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/client/HttpTunnelConnection.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/client/HttpTunnelConnection.java index bf9f6dd439..8cc68bfdb4 100644 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/client/HttpTunnelConnection.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/client/HttpTunnelConnection.java @@ -158,11 +158,11 @@ public class HttpTunnelConnection implements TunnelConnection { } catch (IOException ex) { logger.trace("Unexpected connection error", ex); - closeQuitely(); + closeQuietly(); } } - private void closeQuitely() { + private void closeQuietly() { try { close(); } diff --git a/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java index f64cbba43f..dd64869915 100755 --- a/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java +++ b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java @@ -92,7 +92,7 @@ public class LocalDevToolsAutoConfigurationTests { } @Test - public void defaultPropertyCanBeOverridenFromCommandLine() throws Exception { + public void defaultPropertyCanBeOverriddenFromCommandLine() throws Exception { this.context = initializeAndRun(Config.class, "--spring.thymeleaf.cache=true"); TemplateResolver resolver = this.context.getBean(TemplateResolver.class); resolver.initialize(); @@ -100,7 +100,7 @@ public class LocalDevToolsAutoConfigurationTests { } @Test - public void defaultPropertyCanBeOverridenFromUserHomeProperties() throws Exception { + public void defaultPropertyCanBeOverriddenFromUserHomeProperties() throws Exception { String userHome = System.getProperty("user.home"); System.setProperty("user.home", new File("src/test/resources/user-home").getAbsolutePath()); diff --git a/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfigurationTests.java b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfigurationTests.java index acb2ad1c4e..42075ef632 100644 --- a/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfigurationTests.java +++ b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/RemoteDevToolsAutoConfigurationTests.java @@ -153,7 +153,7 @@ public class RemoteDevToolsAutoConfigurationTests { loadContext("spring.devtools.remote.secret:supersecret", "spring.devtools.remote.restart.enabled:false"); this.thrown.expect(NoSuchBeanDefinitionException.class); - this.context.getBean("remoteRestartHanderMapper"); + this.context.getBean("remoteRestartHandlerMapper"); } @Test @@ -193,7 +193,7 @@ public class RemoteDevToolsAutoConfigurationTests { loadContext("spring.devtools.remote.secret:supersecret", "spring.devtools.remote.debug.enabled:false"); this.thrown.expect(NoSuchBeanDefinitionException.class); - this.context.getBean("remoteDebugHanderMapper"); + this.context.getBean("remoteDebugHandlerMapper"); } @Test diff --git a/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServerTests.java b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServerTests.java index 9734b5e500..7f3a870e76 100644 --- a/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServerTests.java +++ b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/tunnel/server/HttpTunnelServerTests.java @@ -223,7 +223,7 @@ public class HttpTunnelServerTests { } @Test - public void requestRecievedOutOfOrder() throws Exception { + public void requestReceivedOutOfOrder() throws Exception { MockHttpConnection h1 = new MockHttpConnection(); MockHttpConnection h2 = new MockHttpConnection("1+2", 1); MockHttpConnection h3 = new MockHttpConnection("+3", 2);