@@ -66,7 +66,7 @@ private static void validateMapTypeValue(
66
66
if (!(fieldMap instanceof Map )) { // source value is map type means configuration has to be map type
67
67
throw new IllegalArgumentException (
68
68
String .format (
69
- Locale .getDefault () ,
69
+ Locale .ROOT ,
70
70
"[%s] configuration doesn't match actual value type, configuration type is: %s, actual value type is: %s" ,
71
71
sourceKey ,
72
72
fieldMap .getClass ().getName (),
@@ -101,9 +101,9 @@ private static void validateMapTypeValue(
101
101
allowEmpty
102
102
);
103
103
} else if (!(nextSourceValue instanceof String )) {
104
- throw new IllegalArgumentException (String .format (Locale .getDefault () , "map type field [%s] is neither string nor nested type, cannot process it" , key ));
104
+ throw new IllegalArgumentException (String .format (Locale .ROOT , "map type field [%s] is neither string nor nested type, cannot process it" , key ));
105
105
} else if (!allowEmpty && StringUtils .isBlank ((String ) nextSourceValue )) {
106
- throw new IllegalArgumentException (String .format (Locale .getDefault () , "map type field [%s] has empty string value, cannot process it" , key ));
106
+ throw new IllegalArgumentException (String .format (Locale .ROOT , "map type field [%s] has empty string value, cannot process it" , key ));
107
107
}
108
108
}
109
109
});
@@ -126,10 +126,10 @@ private static void validateListTypeValue(
126
126
}
127
127
for (Object element : sourceValue ) {
128
128
if (Objects .isNull (element )) {
129
- throw new IllegalArgumentException (String .format (Locale .getDefault () , "list type field [%s] has null, cannot process it" , sourceKey ));
129
+ throw new IllegalArgumentException (String .format (Locale .ROOT , "list type field [%s] has null, cannot process it" , sourceKey ));
130
130
}
131
131
if (element instanceof List ) { // nested list case.
132
- throw new IllegalArgumentException (String .format (Locale .getDefault () , "list type field [%s] is nested list type, cannot process it" , sourceKey ));
132
+ throw new IllegalArgumentException (String .format (Locale .ROOT , "list type field [%s] is nested list type, cannot process it" , sourceKey ));
133
133
} else if (element instanceof Map ) {
134
134
validateMapTypeValue (
135
135
sourceKey ,
@@ -142,9 +142,9 @@ private static void validateListTypeValue(
142
142
allowEmpty
143
143
);
144
144
} else if (!(element instanceof String )) {
145
- throw new IllegalArgumentException (String .format (Locale .getDefault () , "list type field [%s] has non string value, cannot process it" , sourceKey ));
145
+ throw new IllegalArgumentException (String .format (Locale .ROOT , "list type field [%s] has non string value, cannot process it" , sourceKey ));
146
146
} else if (!allowEmpty && StringUtils .isBlank (element .toString ())) {
147
- throw new IllegalArgumentException (String .format (Locale .getDefault () , "list type field [%s] has empty string, cannot process it" , sourceKey ));
147
+ throw new IllegalArgumentException (String .format (Locale .ROOT , "list type field [%s] has empty string, cannot process it" , sourceKey ));
148
148
}
149
149
}
150
150
}
@@ -161,7 +161,7 @@ private static void validateDepth(
161
161
.orElse (environment .settings ());
162
162
long maxDepth = MapperService .INDEX_MAPPING_DEPTH_LIMIT_SETTING .get (settings );
163
163
if (depth > maxDepth ) {
164
- throw new IllegalArgumentException (String .format (Locale .getDefault () , "map type field [%s] reaches max depth limit, cannot process it" , sourceKey ));
164
+ throw new IllegalArgumentException (String .format (Locale .ROOT , "map type field [%s] reaches max depth limit, cannot process it" , sourceKey ));
165
165
}
166
166
}
167
167
}
0 commit comments