Skip to content

Commit

Permalink
Remove unnecessary parentheses from ternary statements
Browse files Browse the repository at this point in the history
  • Loading branch information
dabico committed Jan 10, 2024
1 parent da13d26 commit f249f4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/ch/usi/si/seart/job/CrawlProjectsJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private void saveRetrievedRepo(JsonObject result, String language, int lowerInde
return;
}

String action = (gitRepo.getId() != null)
String action = gitRepo.getId() != null
? "Updating: "
: "Saving: ";
log.info("{}{} [{}/{}]", action, name, lowerIndex, total);
Expand All @@ -227,14 +227,14 @@ private void saveRetrievedRepo(JsonObject result, String language, int lowerInde
Long size = json.getAsJsonPrimitive("size").getAsLong();
gitRepo.setSize(size);

String homepage = (!json.get("homepage").isJsonNull())
String homepage = !json.get("homepage").isJsonNull()
? json.getAsJsonPrimitive("homepage")
.getAsString()
.trim()
: null;
gitRepo.setHomepage(Strings.emptyToNull(homepage));

String license = (!json.get("license").isJsonNull())
String license = !json.get("license").isJsonNull()
? json.getAsJsonObject("license")
.getAsJsonPrimitive("name")
.getAsString()
Expand Down

0 comments on commit f249f4f

Please sign in to comment.