File tree Expand file tree Collapse file tree 1 file changed +2
-25
lines changed
src/main/java/com/networknt/schema Expand file tree Collapse file tree 1 file changed +2
-25
lines changed Original file line number Diff line number Diff line change 11
11
public class I18nSupport {
12
12
13
13
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 );
28
15
29
16
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 );
40
18
}
41
-
42
19
}
You can’t perform that action at this time.
0 commit comments