From c1a1331f4ced9615e5c139196a7f1761e8be7fb8 Mon Sep 17 00:00:00 2001 From: vvatanabe Date: Mon, 28 Aug 2023 13:28:22 +0900 Subject: [PATCH] fix: use another way to initialize this instance in L33tMatcher --- .../nulabinc/zxcvbn/matchers/L33tMatcher.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/nulabinc/zxcvbn/matchers/L33tMatcher.java b/src/main/java/com/nulabinc/zxcvbn/matchers/L33tMatcher.java index a3a009f..627874e 100644 --- a/src/main/java/com/nulabinc/zxcvbn/matchers/L33tMatcher.java +++ b/src/main/java/com/nulabinc/zxcvbn/matchers/L33tMatcher.java @@ -13,24 +13,24 @@ public class L33tMatcher extends BaseMatcher { private final Map> rankedDictionaries; - private static final Map> L33T_TABLE = - Collections.unmodifiableMap( - new HashMap>() { - { - put('a', Arrays.asList('4', '@')); - put('b', Collections.singletonList('8')); - put('c', Arrays.asList('(', '{', '[', '<')); - put('e', Collections.singletonList('3')); - put('g', Arrays.asList('6', '9')); - put('i', Arrays.asList('1', '!', '|')); - put('l', Arrays.asList('1', '|', '7')); - put('o', Collections.singletonList('0')); - put('s', Arrays.asList('$', '5')); - put('t', Arrays.asList('+', '7')); - put('x', Collections.singletonList('%')); - put('z', Collections.singletonList('2')); - } - }); + private static final Map> L33T_TABLE; + + static { + Map> table = new HashMap<>(); + table.put('a', Arrays.asList('4', '@')); + table.put('b', Collections.singletonList('8')); + table.put('c', Arrays.asList('(', '{', '[', '<')); + table.put('e', Collections.singletonList('3')); + table.put('g', Arrays.asList('6', '9')); + table.put('i', Arrays.asList('1', '!', '|')); + table.put('l', Arrays.asList('1', '|', '7')); + table.put('o', Collections.singletonList('0')); + table.put('s', Arrays.asList('$', '5')); + table.put('t', Arrays.asList('+', '7')); + table.put('x', Collections.singletonList('%')); + table.put('z', Collections.singletonList('2')); + L33T_TABLE = Collections.unmodifiableMap(table); + } public L33tMatcher(Context context, Map> rankedDictionaries) { super(context);