Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion jabkit/src/main/java/org/jabref/cli/CheckConsistency.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public void run() {

BibliographyConsistencyCheck consistencyCheck = new BibliographyConsistencyCheck();
BibliographyConsistencyCheck.Result result = consistencyCheck.check(entries, (count, total) -> {
System.out.println(Localization.lang("Checking consistency for entry type %0 of %1", count + 1, total));
if (!sharedOptions.porcelain) {
System.out.println(Localization.lang("Checking consistency for entry type %0 of %1", count + 1, total));
}
});

Writer writer = new OutputStreamWriter(System.out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ void checkConsistency() throws URISyntaxException {
commandLine.execute(args.toArray(String[]::new));

String output = outContent.toString();
assertTrue(output.contains("Checking consistency for entry type 1 of 1\n"));
assertTrue(output.contains("Consistency check completed"));

System.setOut(System.out);
Expand All @@ -165,7 +166,7 @@ void checkConsistencyPorcelain() throws URISyntaxException {
commandLine.execute(args.toArray(String[]::new));

String output = outContent.toString();
assertEquals("Checking consistency for entry type 1 of 1\n", output);
assertEquals("", output);

System.setOut(System.out);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ private static void collectEntriesIntoMaps(List<BibEntry> entries, Map<EntryType
for (BibEntry entry : entries) {
EntryType entryType = entry.getType();

Set<Field> fieldsInAnyEntry = entryTypeToFieldsInAnyEntryMap.computeIfAbsent(entryType, k -> new HashSet<>());
Set<Field> fieldsInAnyEntry = entryTypeToFieldsInAnyEntryMap.computeIfAbsent(entryType, _ -> new HashSet<>());
fieldsInAnyEntry.addAll(entry.getFields());

Set<Field> fieldsInAllEntries = entryTypeToFieldsInAllEntriesMap.computeIfAbsent(entryType, k -> new HashSet<>(entry.getFields()));
Set<Field> fieldsInAllEntries = entryTypeToFieldsInAllEntriesMap.computeIfAbsent(entryType, _ -> new HashSet<>(entry.getFields()));
fieldsInAllEntries.retainAll(entry.getFields());

Set<BibEntry> entriesOfType = entryTypeToEntriesMap.computeIfAbsent(entryType, k -> new HashSet<>());
Set<BibEntry> entriesOfType = entryTypeToEntriesMap.computeIfAbsent(entryType, _ -> new HashSet<>());
entriesOfType.add(entry);
}
}
Expand Down