From f0cb86001090c3e8ed162307c881ffe762ae9db7 Mon Sep 17 00:00:00 2001 From: Hank CP Date: Tue, 31 Dec 2019 12:40:21 +0800 Subject: [PATCH] fix getMessage() --- build.gradle | 2 +- .../org/laxture/spring/util/ApplicationContextProvider.java | 2 +- version.properties | 0 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 version.properties diff --git a/build.gradle b/build.gradle index 5be9ae8..9dc75a5 100644 --- a/build.gradle +++ b/build.gradle @@ -64,7 +64,7 @@ dependencies { // Properties //************************************************************************* -version = "0.1.1" +version = "0.1.2" //************************************************************************* // Compile & Assemble diff --git a/src/main/java/org/laxture/spring/util/ApplicationContextProvider.java b/src/main/java/org/laxture/spring/util/ApplicationContextProvider.java index 25d88b3..9586a68 100644 --- a/src/main/java/org/laxture/spring/util/ApplicationContextProvider.java +++ b/src/main/java/org/laxture/spring/util/ApplicationContextProvider.java @@ -104,7 +104,7 @@ public static String getMessage(Class probeClazz, String msgKey, Object...par public static String getMessage(ClassLoader classLoader, String msgKey, Object...params) { assert ctxCache.containsKey(classLoader); try { - return Optional.ofNullable(getBean(MessageSource.class)).map(bean -> bean.getMessage( + return Optional.ofNullable(getBean(classLoader, MessageSource.class)).map(bean -> bean.getMessage( msgKey, params, LocaleContextHolder.getLocale())).orElse(msgKey); } catch (NoSuchMessageException ignored) { return msgKey; diff --git a/version.properties b/version.properties deleted file mode 100644 index e69de29..0000000