Skip to content

Commit 81ded89

Browse files
committed
Remove a resource bundle.
There are two reasons: - It is unnecessary becasue we provide english messages only - Substrate VM needs extra configuration to include resource bundles
1 parent 91373b0 commit 81ded89

File tree

4 files changed

+2
-81
lines changed

4 files changed

+2
-81
lines changed

src/main/java/org/seasar/doma/internal/message/AbstractMessageResourceBundle.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/main/java/org/seasar/doma/internal/message/MessageFormatter.java

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/main/java/org/seasar/doma/internal/message/MessageResourceBundle.java

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/main/java/org/seasar/doma/message/Message.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import java.io.PrintWriter;
44
import java.io.StringWriter;
55
import java.text.MessageFormat;
6-
import java.util.MissingResourceException;
7-
import java.util.ResourceBundle;
8-
import org.seasar.doma.internal.message.MessageResourceBundle;
96

107
/** Defines messages that are sent to application developers. */
118
public enum Message implements MessageResource {
@@ -252,7 +249,7 @@ public enum Message implements MessageResource {
252249
+ "but the literal variable directive doesn''t allow it. SQL=[{0}]"),
253250
DOMA2228(
254251
"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}]"),
256253
DOMA2229("The parameter types are different between batched queries."),
257254
DOMA2230("The literals must be consistent between batched queries."),
258255
DOMA2231("The number of parameters is different between batched queries."),
@@ -956,18 +953,7 @@ public String getSimpleMessage(Object... args) {
956953

957954
protected String getSimpleMessageInternal(Object... args) {
958955
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);
971957
} catch (Throwable throwable) {
972958
StringWriter sw = new StringWriter();
973959
PrintWriter pw = new PrintWriter(sw);

0 commit comments

Comments
 (0)