diff --git a/test-case/src/main/java/pkg/UsingGetLocalizedMessage.java b/test-case/src/main/java/pkg/UsingGetLocalizedMessage.java index 4b0dac1d..49306cd1 100644 --- a/test-case/src/main/java/pkg/UsingGetLocalizedMessage.java +++ b/test-case/src/main/java/pkg/UsingGetLocalizedMessage.java @@ -7,6 +7,7 @@ public class UsingGetLocalizedMessage { private final Logger logger = LoggerFactory.getLogger(getClass()); void method(Throwable t) { + logger.info("My message is {}", t.getLocalizedMessage()); logger.info("My message is {}", t.getLocalizedMessage(), t); logger.info("My {} is {}", new Object[]{ "message", t.getLocalizedMessage(), t }); logger.info("My {} {} {}", new Object[]{ "message", "is", t.getLocalizedMessage(), t }); diff --git a/test-case/src/main/java/pkg/UsingGetMessage.java b/test-case/src/main/java/pkg/UsingGetMessage.java index 496a7e6d..f8fad4ca 100644 --- a/test-case/src/main/java/pkg/UsingGetMessage.java +++ b/test-case/src/main/java/pkg/UsingGetMessage.java @@ -7,6 +7,7 @@ public class UsingGetMessage { private final Logger logger = LoggerFactory.getLogger(getClass()); void method(Throwable t) { + logger.info("My message is {}", t.getMessage()); logger.info("My message is {}", t.getMessage(), t); logger.info("My {} is {}", new Object[]{ "message", t.getMessage(), t }); logger.info("My {} {} {}", new Object[]{ "message", "is", t.getMessage(), t }); diff --git a/test-case/src/test/java/jp/skypencil/findbugs/slf4j/UsingGetLocalizedMessageTest.java b/test-case/src/test/java/jp/skypencil/findbugs/slf4j/UsingGetLocalizedMessageTest.java index 91c448ec..5c048688 100644 --- a/test-case/src/test/java/jp/skypencil/findbugs/slf4j/UsingGetLocalizedMessageTest.java +++ b/test-case/src/test/java/jp/skypencil/findbugs/slf4j/UsingGetLocalizedMessageTest.java @@ -12,7 +12,7 @@ public class UsingGetLocalizedMessageTest { @Test public void test() { - Map expected = Collections.singletonMap("SLF4J_MANUALLY_PROVIDED_MESSAGE", 3); + Map expected = Collections.singletonMap("SLF4J_MANUALLY_PROVIDED_MESSAGE", 4); Multimap longMessages = new XmlParser().expect(pkg.UsingGetLocalizedMessage.class, expected); assertThat(longMessages).containsEntry("SLF4J_MANUALLY_PROVIDED_MESSAGE", "Do not have to use message returned from Throwable#getMessage and Throwable#getLocalizedMessage. It is enough to provide throwable instance as the last argument, then binding will log its message."); diff --git a/test-case/src/test/java/jp/skypencil/findbugs/slf4j/UsingGetMessageTest.java b/test-case/src/test/java/jp/skypencil/findbugs/slf4j/UsingGetMessageTest.java index f65081f2..86013c1a 100644 --- a/test-case/src/test/java/jp/skypencil/findbugs/slf4j/UsingGetMessageTest.java +++ b/test-case/src/test/java/jp/skypencil/findbugs/slf4j/UsingGetMessageTest.java @@ -12,7 +12,7 @@ public class UsingGetMessageTest { @Test public void test() { - Map expected = Collections.singletonMap("SLF4J_MANUALLY_PROVIDED_MESSAGE", 3); + Map expected = Collections.singletonMap("SLF4J_MANUALLY_PROVIDED_MESSAGE", 4); Multimap longMessages = new XmlParser().expect(pkg.UsingGetMessage.class, expected); assertThat(longMessages).containsEntry("SLF4J_MANUALLY_PROVIDED_MESSAGE", "Do not have to use message returned from Throwable#getMessage and Throwable#getLocalizedMessage. It is enough to provide throwable instance as the last argument, then binding will log its message.");