Skip to content

Commit

Permalink
fix typo and use new switch case syntax;
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Maute <stefan.maute@bosch.io>
  • Loading branch information
Stefan Maute committed Jun 20, 2022
1 parent 77c7438 commit f64d7b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ enum ConfigValue implements KnownConfigValue {
WAIT_UNTIL_BUFFER_FLUSHED("waitUntilBufferFlushed", Duration.ofSeconds(60)),

/**
* When closing flusher, wait that long for resoruces until forcefully stopping.
* When closing flusher, wait that long for resources until forcefully stopping.
*/
WAIT_UNTIL_FLUSHER_TERMINATED("waitUntilFlusherTerminated", Duration.ofSeconds(60)),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private ConnectionLoggerFactory() {

/**
* Creates a new {@link ConnectionLogger} that will
* evict old messages. Moreover it will have some predefined default log messages for its {@code logCategory} and
* evict old messages. Moreover, it will have some predefined default log messages for its {@code logCategory} and
* {@code logType}.
*
* @param successCapacity how many success messages will be stored by the logger.
Expand All @@ -64,18 +64,13 @@ static ConnectionLogger newEvictingLogger(
final LogCategory logCategory, final LogType logType,
@Nullable final String address) {

switch (logCategory) {
case SOURCE:
return newSourceLogger(logType, successCapacity, failureCapacity, address);
case TARGET:
return newTargetLogger(logType, successCapacity, failureCapacity, address);
case RESPONSE:
return newResponseLogger(logType, successCapacity, failureCapacity, address);
case CONNECTION:
return newConnectionLogger(logType, successCapacity, failureCapacity, address);
default:
throw new AssertionError("Missing switch case.");
}
return switch (logCategory) {
case SOURCE -> newSourceLogger(logType, successCapacity, failureCapacity, address);
case TARGET -> newTargetLogger(logType, successCapacity, failureCapacity, address);
case RESPONSE -> newResponseLogger(logType, successCapacity, failureCapacity, address);
case CONNECTION -> newConnectionLogger(logType, successCapacity, failureCapacity, address);
default -> throw new AssertionError("Missing switch case.");
};
}

/**
Expand Down

0 comments on commit f64d7b3

Please sign in to comment.