Skip to content

Commit 6499e47

Browse files
committed
CLDR-18840 Spotless
1 parent 4ce441f commit 6499e47

File tree

1 file changed

+39
-24
lines changed

1 file changed

+39
-24
lines changed

tools/cldr-code/src/main/java/org/unicode/cldr/tool/ListCoverageLevels.java

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,16 @@ enum Target {
6363
TC,
6464
DDL
6565
}
66+
6667
private static final Set<String> VALID_REGULAR_UNITS =
6768
Validity.getInstance().getStatusToCodes(LstrType.unit).get(Validity.Status.regular);
68-
69-
static final StandardCodes stdCodes = StandardCodes.make();
7069

71-
static final Set<String> cldrCoverage = Sets.difference(stdCodes.getLocaleCoverageLocales(Organization.cldr), stdCodes.getLocaleCoverageLocales(Organization.special));
70+
static final StandardCodes stdCodes = StandardCodes.make();
71+
72+
static final Set<String> cldrCoverage =
73+
Sets.difference(
74+
stdCodes.getLocaleCoverageLocales(Organization.cldr),
75+
stdCodes.getLocaleCoverageLocales(Organization.special));
7276

7377
private static String levelName(Level level) {
7478
return level == Level.COMPREHENSIVE ? "ꞏ" + level : level.toString();
@@ -106,37 +110,39 @@ public static void main(String[] args) {
106110
toTest.forEach(locale -> _ALL.add(CLDRLocale.getInstance(locale)));
107111
ALL = ImmutableSet.copyOf(_ALL);
108112
}
109-
113+
110114
Organization foo;
111115

112116
Map<Target, Map<Level, Multiset<String>>> TcToLevelToCounter = new TreeMap<>();
113117

114118
for (Target target : Target.values()) {
115119
Map<Level, Multiset<String>> levelToCounter = new TreeMap<>();
116-
for (Level level : Level.values()) {
120+
for (Level level : Level.values()) {
117121
levelToCounter.put(level, TreeMultiset.create());
118-
}
119-
TcToLevelToCounter.put(target, levelToCounter);
122+
}
123+
TcToLevelToCounter.put(target, levelToCounter);
120124
}
121125

122126
Map<Level, Multiset<String>> unitLevelToCounter = new TreeMap<>();
123127
Multimap<String, String> unitToLocales = TreeMultimap.create();
124-
for (Level level : Level.values()) {
125-
unitLevelToCounter.put(level, TreeMultiset.create());
126-
}
127-
128+
for (Level level : Level.values()) {
129+
unitLevelToCounter.put(level, TreeMultiset.create());
130+
}
128131

129132
for (String locale : toTest) {
130-
Optional<CLDRLocale> contained = localeOrAncestorMatches(locale, itOrParent -> cldrCoverage.contains(itOrParent.toString()));
133+
Optional<CLDRLocale> contained =
134+
localeOrAncestorMatches(
135+
locale, itOrParent -> cldrCoverage.contains(itOrParent.toString()));
131136
Target target = contained.isPresent() ? Target.TC : Target.DDL;
132-
137+
133138
CLDRFile file = mainAndAnnotationsFactory.make(locale, false);
134139
CoverageLevel2 coverageLeveler = null;
135140
try {
136141
coverageLeveler = CoverageLevel2.getInstance(locale);
137142
} catch (Exception e) {
138143
}
139-
System.out.println(locale + "\t" + target + "\t" + (target == Target.TC ? contained.get() : ""));
144+
System.out.println(
145+
locale + "\t" + target + "\t" + (target == Target.TC ? contained.get() : ""));
140146
for (String path : file) {
141147
Level level =
142148
coverageLeveler == null
@@ -159,18 +165,24 @@ public static void main(String[] args) {
159165

160166
for (Entry<Target, Map<Level, Multiset<String>>> entry0 : TcToLevelToCounter.entrySet()) {
161167
Target target = entry0.getKey();
162-
for (Entry<Level, Multiset<String>> entry : entry0.getValue().entrySet()) {
163-
Level level = entry.getKey();
164-
Multiset<String> counter = entry.getValue();
165-
for (Multiset.Entry<String> skeleton : counter.entrySet()) {
166-
System.out.println(
167-
target + "\t" + levelName(level) + "\t" + skeleton.getCount() + "\t" + skeleton.getElement());
168+
for (Entry<Level, Multiset<String>> entry : entry0.getValue().entrySet()) {
169+
Level level = entry.getKey();
170+
Multiset<String> counter = entry.getValue();
171+
for (Multiset.Entry<String> skeleton : counter.entrySet()) {
172+
System.out.println(
173+
target
174+
+ "\t"
175+
+ levelName(level)
176+
+ "\t"
177+
+ skeleton.getCount()
178+
+ "\t"
179+
+ skeleton.getElement());
180+
}
168181
}
169182
}
170-
}
171183

172184
if (true) return;
173-
185+
174186
System.out.println("\nUnits\n");
175187
System.out.println(
176188
JOIN_TAB.join(
@@ -287,8 +299,11 @@ public static void main(String[] args) {
287299
}
288300
}
289301

290-
private static Optional<CLDRLocale> localeOrAncestorMatches(String locale, Predicate<? super CLDRLocale> condition) {
291-
return Streams.stream(CLDRLocale.getInstance(locale).getParentIterator()).filter(condition).findFirst();
302+
private static Optional<CLDRLocale> localeOrAncestorMatches(
303+
String locale, Predicate<? super CLDRLocale> condition) {
304+
return Streams.stream(CLDRLocale.getInstance(locale).getParentIterator())
305+
.filter(condition)
306+
.findFirst();
292307
}
293308

294309
private static void showUnit(

0 commit comments

Comments
 (0)