From 601c6aa3052031b8ba0d0f37486ab9b04c0d8707 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 9 Feb 2017 13:48:55 +0000 Subject: [PATCH] Tidy up code formatting and address some compiler warnings --- .../boot/autoconfigure/condition/ConditionMessage.java | 5 ++--- .../autoconfigure/amqp/RabbitAutoConfigurationTests.java | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java index 43ee2251de..53e03ed134 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java @@ -301,9 +301,8 @@ public final class ConditionMessage { if (StringUtils.isEmpty(reason)) { return new ConditionMessage(ConditionMessage.this, this.condition); } - return new ConditionMessage(ConditionMessage.this, - this.condition + (StringUtils.isEmpty(this.condition) ? "" : " ") - + reason); + return new ConditionMessage(ConditionMessage.this, this.condition + + (StringUtils.isEmpty(this.condition) ? "" : " ") + reason); } } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java index 5a22d1324e..7db7b272bb 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java @@ -295,7 +295,7 @@ public class RabbitAutoConfigurationTests { @Test public void testRabbitListenerContainerFactoryWithCustomSettings() { load(new Class[] { MessageConvertersConfiguration.class, - MessageRecoverersConfiguration.class }, + MessageRecoverersConfiguration.class }, "spring.rabbitmq.listener.retry.enabled:true", "spring.rabbitmq.listener.retry.maxAttempts:4", "spring.rabbitmq.listener.retry.initialInterval:2000", @@ -331,11 +331,11 @@ public class RabbitAutoConfigurationTests { dfa = new DirectFieldAccessor(adviceChain[0]); MessageRecoverer messageRecoverer = this.context.getBean("myMessageRecoverer", MessageRecoverer.class); - MethodInvocationRecoverer mir = (MethodInvocationRecoverer) dfa + MethodInvocationRecoverer mir = (MethodInvocationRecoverer) dfa .getPropertyValue("recoverer"); Message message = mock(Message.class); Exception ex = new Exception("test"); - mir.recover(new Object[]{"foo", message}, ex); + mir.recover(new Object[] { "foo", message }, ex); verify(messageRecoverer).recover(message, ex); RetryTemplate retryTemplate = (RetryTemplate) dfa .getPropertyValue("retryOperations"); @@ -415,8 +415,7 @@ public class RabbitAutoConfigurationTests { load(new Class[] { config }, environment); } - private void load(Class[] configs, - String... environment) { + private void load(Class[] configs, String... environment) { AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(); applicationContext.register(configs); applicationContext.register(RabbitAutoConfiguration.class);