MCPcopy Create free account
hub / github.com/BaseXdb/basex / check

Method check

basex-core/src/main/java/org/basex/core/Lang.java:133–159  ·  view source on GitHub ↗

Checks the existing language files for correctness and completeness.

()

Source from the content-addressed store, hash-verified

131 * Checks the existing language files for correctness and completeness.
132 */
133 static void check() {
134 read(Prop.language);
135 final StringBuilder sb = new StringBuilder();
136 final HashSet<String> set = new HashSet<>(TEXTS.keySet());
137
138 final IOFile[] files = new IOFile("src/main/resources/lang").children();
139 for(final IOFile file : files) {
140 final String lang = file.name().replace('.' + SUFFIX, "");
141 if(lang.equals(Prop.language)) continue;
142
143 read(lang);
144 for(final String text : set.toArray(String[]::new)) {
145 if(TEXTS.remove(text) == null) sb.append("- ").append(text).append('\n');
146 }
147 if(!sb.isEmpty()) {
148 Util.err("Missing in %.lang:\n%", lang, sb);
149 sb.setLength(0);
150 }
151 for(final String s : TEXTS.keySet()) {
152 sb.append("- ").append(s).append('\n');
153 }
154 if(!sb.isEmpty()) {
155 Util.err("Not defined in %.lang:\n%", lang, sb);
156 sb.setLength(0);
157 }
158 }
159 }
160}

Callers 1

testMethod · 0.95

Calls 10

readMethod · 0.95
errMethod · 0.95
nameMethod · 0.65
removeMethod · 0.65
appendMethod · 0.65
childrenMethod · 0.45
replaceMethod · 0.45
equalsMethod · 0.45
toArrayMethod · 0.45
isEmptyMethod · 0.45

Tested by 1

testMethod · 0.76