Make use of null-checked variable (#13040)

This commit is contained in:
sabi0 2024-01-29 09:19:07 +01:00 committed by GitHub
parent fe4631c8d2
commit 21e545501e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 4 deletions

View File

@ -217,7 +217,7 @@ public class SearchFiles {
System.out.println((i + 1) + ". " + path); System.out.println((i + 1) + ". " + path);
String title = doc.get("title"); String title = doc.get("title");
if (title != null) { if (title != null) {
System.out.println(" Title: " + doc.get("title")); System.out.println(" Title: " + title);
} }
} else { } else {
System.out.println((i + 1) + ". " + "No path for this document"); System.out.println((i + 1) + ". " + "No path for this document");

View File

@ -322,8 +322,7 @@ public class SortedSetDocValuesFacetCounts extends AbstractSortedSetDocValueFace
if (liveDocs == null) { if (liveDocs == null) {
countOneSegmentNHLD(ordinalMap, context.reader(), context.ord); countOneSegmentNHLD(ordinalMap, context.reader(), context.ord);
} else { } else {
countOneSegment( countOneSegment(ordinalMap, context.reader(), context.ord, null, liveDocs);
ordinalMap, context.reader(), context.ord, null, context.reader().getLiveDocs());
} }
} }
} }

View File

@ -54,7 +54,7 @@ public class MessageFilesParser extends SimpleFileVisitor<Path> {
if (attr.isRegularFile()) { if (attr.isRegularFile()) {
Message message = parse(file); Message message = parse(file);
if (message != null) { if (message != null) {
messages.add(parse(file)); messages.add(message);
} }
} }
} catch (IOException e) { } catch (IOException e) {