File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed
validator/src/main/java/io/avaje/validation/core Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -26,15 +26,7 @@ final class DResourceBundleManager {
26
26
}
27
27
28
28
for (final var bundle : providedBundles ) {
29
- map .compute (
30
- bundle .getLocale (),
31
- (local , list ) -> {
32
- if (list == null ) {
33
- list = new ArrayList <>();
34
- }
35
- list .add (bundle );
36
- return list ;
37
- });
29
+ map .computeIfAbsent (bundle .getLocale (), key -> new ArrayList <>()).add (bundle );
38
30
}
39
31
// since default is added last, it will be the last place messages will be resolved
40
32
addBundle (DEFAULT_BUNDLE , localeResolver .defaultLocale ());
@@ -45,15 +37,7 @@ final class DResourceBundleManager {
45
37
}
46
38
47
39
private void addBundle (final String name , final Locale locale ) {
48
- map .compute (
49
- locale ,
50
- (local , list ) -> {
51
- if (list == null ) {
52
- list = new ArrayList <>();
53
- }
54
- list .add (getBundle (name , local ));
55
- return list ;
56
- });
40
+ map .computeIfAbsent (locale , key -> new ArrayList <>()).add (getBundle (name , locale ));
57
41
}
58
42
59
43
@ Nullable
You can’t perform that action at this time.
0 commit comments