Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions src/main/java/com/networknt/schema/I18nSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,9 @@
public class I18nSupport {

private static final String BASE_NAME = "jsv-messages";
private static final ResourceBundle bundle;

static {
ResourceBundle tmpBundle = null;
try {
tmpBundle = ResourceBundle.getBundle(BASE_NAME);
} catch (MissingResourceException mre) {
// Need to avoid by all means that we fail loading ValidatorTypeCode with a
// "java.lang.NoClassDefFoundError: Could not initialize class com.networknt.schema.ValidatorTypeCode"
// due to the fact that a ResourceBundle is incomplete
mre.printStackTrace();
}
bundle = tmpBundle;
}
private static final ResourceBundle bundle = ResourceBundle.getBundle(BASE_NAME);

public static String getString(String key) {
String retval = null;
try {
retval = bundle.getString(key);
} catch (MissingResourceException mre) {
// Need to avoid by all means that we fail loading ValidatorTypeCode with a
// "java.lang.NoClassDefFoundError: Could not initialize class com.networknt.schema.ValidatorTypeCode"
// due to the fact that a ResourceBundle is incomplete
mre.printStackTrace();
}
return retval;
return bundle.getString(key);
}

}