sashapolo commented on code in PR #6719:
URL: https://github.com/apache/ignite-3/pull/6719#discussion_r2413664322
##########
modules/core/src/main/java/org/apache/ignite/internal/util/ExceptionUtils.java:
##########
@@ -928,165 +927,165 @@ abstract <T extends Throwable> T copy(
private static final List<ExceptionFactory> EXCEPTION_FACTORIES;
static {
- EXCEPTION_FACTORIES = new ArrayList<>();
-
- // The most specific signatures should go in the first place.
- // Exception(UUID traceId, int code, String message, Throwable cause)
- EXCEPTION_FACTORIES.add(new ExceptionFactory(methodType(void.class,
UUID.class, int.class, String.class, Throwable.class)) {
- @Override
- <T extends Throwable> T copy(MethodHandle constructor, UUID
traceId, int code, String message, Throwable cause)
- throws Throwable {
- return (T) constructor.invokeWithArguments(traceId, code,
message, cause);
- }
- });
- // Exception(UUID traceId, int code, String message)
- EXCEPTION_FACTORIES.add(new ExceptionFactory(methodType(void.class,
UUID.class, int.class, String.class)) {
- @Override
- <T extends Throwable> T copy(MethodHandle constructor, UUID
traceId, int code, String message, Throwable cause)
- throws Throwable {
- T copy = (T) constructor.invokeWithArguments(traceId, code,
message);
- if (cause != null) {
- try {
- copy.initCause(cause);
- } catch (IllegalStateException ignore) {
- // No-op.
+ EXCEPTION_FACTORIES = List.of(
Review Comment:
Note to reviewer: these changes mostly come from me replacing the `new
ArrayList` with `List.of`, the code inside has not changed. The most important
change is that `Exception(Throwable cause)` is now above `Exception(String msg)`
--
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]