Skip to content

Commit

Permalink
fix sonar findings
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed Aug 30, 2024
1 parent 9f3eaba commit f3baca2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/alfio/manager/AccessService.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import alfio.repository.user.OrganizationRepository;
import alfio.repository.user.UserRepository;
import alfio.repository.user.join.UserOrganizationRepository;
import alfio.util.MiscUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -579,7 +580,7 @@ public void checkEventAndReservationOwnership(Principal principal, String eventN
var eventAndOrgId = checkEventOwnership(principal, eventName);
if (reservationIds.size() != reservationRepository.countReservationsWithEventId(reservationIds, eventAndOrgId.getId())) {
if (log.isWarnEnabled()) {
log.warn("Some reservation ids {} are not in the event {}", reservationIds, removeTabsAndNewlines(eventName));
log.warn("Some reservation ids {} are not in the event {}", reservationIds.stream().map(MiscUtils::removeTabsAndNewlines).collect(Collectors.toSet()), removeTabsAndNewlines(eventName));
}
throw new AccessDeniedException();
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/alfio/manager/PassKitManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ public Optional<Pair<EventAndOrganizationId, Ticket>> validateToken(String event

var eventOptional = eventRepository.findOptionalEventAndOrganizationIdByShortName(eventName);
if(eventOptional.isEmpty()) {
log.trace("event {} not found", eventName);
if (log.isTraceEnabled()) {
log.trace("event {} not found", removeTabsAndNewlines(eventName));
}
return Optional.empty();
}

Expand Down

0 comments on commit f3baca2

Please sign in to comment.