Skip to content

Commit

Permalink
chore(quality): [eclipse-tractusx#841] simplify string construction
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmf committed Jul 29, 2024
1 parent 1ea18d6 commit 1e0cf3e
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,8 @@ void shouldUseExceptionMessageWhenSuppressedExceptionNotPresent() {
}

private String zonedDateTimeExcerpt(ZonedDateTime dateTime) {
return new StringBuilder().append(dateTime.getYear())
.append("-")
.append(dateTime.getMonth())
.append("-")
.append(dateTime.getDayOfMonth())
.append("T")
.append(dateTime.getHour())
.append(":")
.append(dateTime.getMinute())
.append(":")
.append(dateTime.getSecond())
.toString();
return "%d-%s-%dT%d:%d:%d".formatted(dateTime.getYear(), dateTime.getMonth(), dateTime.getDayOfMonth(),
dateTime.getHour(), dateTime.getMinute(), dateTime.getSecond());
}

}

0 comments on commit 1e0cf3e

Please sign in to comment.