Skip to content

Commit 7afdd3b

Browse files
authored
fixes #709 throw the exception as it is (#717)
1 parent 3c93e45 commit 7afdd3b

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

src/main/java/com/networknt/schema/I18nSupport.java

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,9 @@
1111
public class I18nSupport {
1212

1313
private static final String BASE_NAME = "jsv-messages";
14-
private static final ResourceBundle bundle;
15-
16-
static {
17-
ResourceBundle tmpBundle = null;
18-
try {
19-
tmpBundle = ResourceBundle.getBundle(BASE_NAME);
20-
} catch (MissingResourceException mre) {
21-
// Need to avoid by all means that we fail loading ValidatorTypeCode with a
22-
// "java.lang.NoClassDefFoundError: Could not initialize class com.networknt.schema.ValidatorTypeCode"
23-
// due to the fact that a ResourceBundle is incomplete
24-
mre.printStackTrace();
25-
}
26-
bundle = tmpBundle;
27-
}
14+
private static final ResourceBundle bundle = ResourceBundle.getBundle(BASE_NAME);
2815

2916
public static String getString(String key) {
30-
String retval = null;
31-
try {
32-
retval = bundle.getString(key);
33-
} catch (MissingResourceException mre) {
34-
// Need to avoid by all means that we fail loading ValidatorTypeCode with a
35-
// "java.lang.NoClassDefFoundError: Could not initialize class com.networknt.schema.ValidatorTypeCode"
36-
// due to the fact that a ResourceBundle is incomplete
37-
mre.printStackTrace();
38-
}
39-
return retval;
17+
return bundle.getString(key);
4018
}
41-
4219
}

0 commit comments

Comments
 (0)