fjtirado commented on code in PR #4146:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4146#discussion_r2758767329
##########
addons/common/rest-exception-handler/src/main/java/org/kie/kogito/resource/exceptions/AbstractExceptionsHandler.java:
##########
@@ -96,18 +99,13 @@ protected
AbstractExceptionsHandler(Iterable<ExceptionHandler> errorHandlers) {
}
private T fromErrorCode(ExceptionBodyMessage message) {
- switch (message.getErrorCode()) {
- case "400":
- return badRequest(message);
- case "403":
- return forbidden(message);
- case "404":
- return notFound(message);
- case "409":
- return conflict(message);
- default:
- return internalError(message);
- }
+ return switch (message.getErrorCode()) {
+ case "400" -> badRequest(message);
Review Comment:
This change is fine (because of updated java version) but I do not think is
a good practice to perform unrelated changes (except trivial ones, this one is
on a grey area)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]