|
3 | 3 | import java.io.PrintWriter; |
4 | 4 | import java.io.StringWriter; |
5 | 5 | import java.text.MessageFormat; |
6 | | -import java.util.MissingResourceException; |
7 | | -import java.util.ResourceBundle; |
8 | | -import org.seasar.doma.internal.message.MessageResourceBundle; |
9 | 6 |
|
10 | 7 | /** Defines messages that are sent to application developers. */ |
11 | 8 | public enum Message implements MessageResource { |
@@ -252,7 +249,7 @@ public enum Message implements MessageResource { |
252 | 249 | + "but the literal variable directive doesn''t allow it. SQL=[{0}]"), |
253 | 250 | DOMA2228( |
254 | 251 | "Failed to parse the SQL on line {1} at column {2}. " |
255 | | - + "While the literal directive \"{3\" is defined, the expression is none. SQL=[{0}]"), |
| 252 | + + "While the literal directive \"{3}\" is defined, the expression is none. SQL=[{0}]"), |
256 | 253 | DOMA2229("The parameter types are different between batched queries."), |
257 | 254 | DOMA2230("The literals must be consistent between batched queries."), |
258 | 255 | DOMA2231("The number of parameters is different between batched queries."), |
@@ -956,18 +953,7 @@ public String getSimpleMessage(Object... args) { |
956 | 953 |
|
957 | 954 | protected String getSimpleMessageInternal(Object... args) { |
958 | 955 | try { |
959 | | - boolean fallback = false; |
960 | | - ResourceBundle bundle; |
961 | | - try { |
962 | | - bundle = ResourceBundle.getBundle(MessageResourceBundle.class.getName()); |
963 | | - } catch (MissingResourceException ignored) { |
964 | | - fallback = true; |
965 | | - bundle = new MessageResourceBundle(); |
966 | | - } |
967 | | - String code = name(); |
968 | | - String pattern = bundle.getString(code); |
969 | | - String message = MessageFormat.format(pattern, args); |
970 | | - return fallback ? "(This is a fallback message) " + message : message; |
| 956 | + return MessageFormat.format(messagePattern, args); |
971 | 957 | } catch (Throwable throwable) { |
972 | 958 | StringWriter sw = new StringWriter(); |
973 | 959 | PrintWriter pw = new PrintWriter(sw); |
|
0 commit comments