Skip to content

Commit

Permalink
fix : sonar bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Oct 25, 2023
1 parent 4dcfadc commit b2a0fc6
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,11 @@ public SearchPage<Restaurant> aggregateSearch(
private void addDateRange(DateRangeAggregationBuilder dateRangeBuilder) {
ZonedDateTime zonedDateTime =
ZonedDateTime.now().withDayOfMonth(1).toLocalDate().atStartOfDay(ZoneId.of("UTC"));
dateRangeBuilder.addUnboundedTo(zonedDateTime.minusMonths(12));
for (int i = 12; i > 0; i--) {
dateRangeBuilder.addUnboundedTo(zonedDateTime.minusMonths(12L));
for (long i = 12; i > 0; i--) {
dateRangeBuilder.addRange(
zonedDateTime.minusMonths(i), zonedDateTime.minusMonths(i - 1).minusSeconds(1));
zonedDateTime.minusMonths(i),
zonedDateTime.minusMonths(i - 1L).minusSeconds(1L));
}
dateRangeBuilder.addUnboundedFrom(zonedDateTime);
}
Expand Down

0 comments on commit b2a0fc6

Please sign in to comment.