Skip to content

Commit

Permalink
Fix errorprone issues
Browse files Browse the repository at this point in the history
  • Loading branch information
agentgt committed Nov 14, 2024
1 parent 531d713 commit 9a9a9f0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/java/io/jstach/rainbowgum/LevelResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ record MapLevelResolver(Map<String, Level> levels) implements LevelConfig {
return levels.get(name);
}
}

@SuppressWarnings("ArrayRecordComponent")
record CompositeLevelConfig(LevelConfig[] levelConfigs) implements LevelConfig {

@Override
Expand All @@ -475,6 +475,7 @@ public String toString() {

}

@SuppressWarnings("ArrayRecordComponent")
record CompositeLevelResolver(LevelResolver[] resolvers, Level defaultLevel) implements LevelResolver {

public static LevelResolver of(Collection<? extends LevelResolver> resolvers) {
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/io/jstach/rainbowgum/LogAppender.java
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ default List<LogResponse> act(LogAction action) {

}

@SuppressWarnings("ArrayRecordComponent")
record CompositeLogAppender(DirectLogAppender[] appenders,
AppenderLock lock) implements BaseComposite<DirectLogAppender>, InternalLogAppender {

Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/io/jstach/rainbowgum/LogEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ public LogEvent freeze(Instant timestamp) {
}
}

@SuppressWarnings("ArrayRecordComponent")
record ArrayArgLogEvent(Instant timestamp, String threadName, long threadId, System.Logger.Level level,
String loggerName, String message, KeyValues keyValues, LogMessageFormatter messageFormatter,
@Nullable Throwable throwableOrNull, @Nullable Object[] args, int length) implements LogEvent {
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/io/jstach/rainbowgum/LogFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ public void format(StringBuilder output, LogEvent event) {

}

@SuppressWarnings("ArrayRecordComponent")
record CompositeFormatter(LogFormatter[] formatters) implements EventFormatter {

static String[] SPACES = { " ", " ", " ", " ", // 1,2,4,8 spaces
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/io/jstach/rainbowgum/LogProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,7 @@ default StringBuilder toString(StringBuilder sb) {

}

@SuppressWarnings("ArrayRecordComponent") // TODO we did this originall because it was hot path but not anymore
record CompositeMutableLogProperties(LogProperties[] properties) implements ListLogProperties, MutableLogProperties {

@Override
Expand All @@ -1541,6 +1542,7 @@ public String toString() {

}

@SuppressWarnings("ArrayRecordComponent") // TODO we did this originall because it was hot path but not anymore
record CompositeLogProperties(LogProperties[] properties) implements ListLogProperties {
@Override
public String toString() {
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/io/jstach/rainbowgum/LogRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ public Route route(String loggerName, Level level) {

}

@SuppressWarnings("ArrayRecordComponent") // TODO revisit perf
record CompositeLogRouter(Router[] routers, LevelResolver levelResolver,
RouteChangePublisher changePublisher) implements InternalRootRouter, Route {

Expand Down

0 comments on commit 9a9a9f0

Please sign in to comment.