Skip to content

Commit 4095db0

Browse files
author
Vladimir Kotal
committed
use isEmpty()
1 parent b1860bc commit 4095db0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/web/SearchHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public SearchHelper prepareExec(SortedSet<String> projects) {
319319
searcher = new IndexSearcher(reader);
320320
} else {
321321
errorMsg = "Failed to initialize search. Check the index";
322-
if (projects.size() > 0) {
322+
if (!projects.isEmpty()) {
323323
errorMsg += " for projects: " + String.join(", ", projects);
324324
}
325325
return this;
@@ -347,7 +347,7 @@ public SearchHelper prepareExec(SortedSet<String> projects) {
347347
errorMsg = PARSE_ERROR_MSG + e.getMessage();
348348
} catch (FileNotFoundException e) {
349349
errorMsg = "Index database not found. Check the index";
350-
if (projects.size() > 0) {
350+
if (!projects.isEmpty()) {
351351
errorMsg += " for projects: " + String.join(", ", projects);
352352
}
353353
errorMsg += "; " + e.getMessage();

0 commit comments

Comments
 (0)