Skip to content

Commit

Permalink
Fix style check
Browse files Browse the repository at this point in the history
  • Loading branch information
blootsvoets committed Oct 3, 2023
1 parent 70b64b8 commit 1e80066
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.time.ZoneId;
import java.util.List;

import ch.qos.logback.classic.pattern.ClassicConverter;
import ch.qos.logback.classic.pattern.TargetLengthBasedClassNameAbbreviator;
import org.radarbase.management.security.Constants;
import org.radarbase.management.config.audit.AuditEventConverter;
Expand All @@ -28,7 +27,7 @@ public class CustomAuditEventRepository implements AuditEventRepository {

private static final String AUTHORIZATION_FAILURE = "AUTHORIZATION_FAILURE";

private static final TargetLengthBasedClassNameAbbreviator typeAbbreviator =
private static final TargetLengthBasedClassNameAbbreviator TYPE_ABBREVIATOR =
new TargetLengthBasedClassNameAbbreviator(15);

@Autowired
Expand Down Expand Up @@ -62,12 +61,9 @@ public void add(AuditEvent event) {
}
if (eventType != null && eventType.endsWith("_FAILURE")) {
Object typeObj = event.getData().get("type");
String errorType;
if (typeObj instanceof String) {
errorType = typeAbbreviator.abbreviate((String) typeObj);
} else {
errorType = null;
}
String errorType = typeObj instanceof String
? TYPE_ABBREVIATOR.abbreviate((String) typeObj)
: null;
logger.warn("{}: principal={}, error={}, message=\"{}\", details={}",
eventType,
event.getPrincipal(),
Expand Down

0 comments on commit 1e80066

Please sign in to comment.