Java 17 compatible update#18
Conversation
55f7288 to
91a743c
Compare
README.md
Outdated
There was a problem hiding this comment.
implements ExceptionMessageSetter ?
| S exceptionToBeThrown = exceptionsThrown.get(exceptionKey).instantiate(); | ||
| detailMessageField.set(exceptionToBeThrown, getMessageFromResponse(apiResponse)); | ||
| if (exceptionToBeThrown instanceof ExceptionMessageSetter) { | ||
| ((ExceptionMessageSetter) exceptionToBeThrown) |
There was a problem hiding this comment.
Should we log something to let the devs know that the exception message will not be set otherwise?
There was a problem hiding this comment.
maybe during initialization?
There was a problem hiding this comment.
well, it's set to something and depending on how your constructors are set up, it might be the expected message.
I could log something once when parsing the exception, that's not a bad idea I'll try something
There was a problem hiding this comment.
I've added a log that logs only once.
91a743c to
89746ec
Compare
| @@ -159,6 +185,11 @@ | ||
| <target>1.8</target> |
There was a problem hiding this comment.
c'est encore en java 8?
There was a problem hiding this comment.
Yes there isnt much incentive to bump the Java version here
| @@ -37,13 +37,12 @@ public abstract class ReflectionErrorDecoder<T, S extends Exception> implements | ||
| private static final Logger logger = LoggerFactory.getLogger(ReflectionErrorDecoder.class); | ||
| private static final List<Object> SUPPORTED_CONSTRUCTOR_ARGUMENTS = | ||
| Arrays.asList( |
| if (!exceptionMessageHandlingLogged | ||
| && !ExceptionMessageSetter.class.isAssignableFrom(clazz)) { | ||
| logger.warn( | ||
| "The class '{}' or its superclass(es) do not implement ExceptionMessageSetter, therefore the Throwable detailMessage field will not be set. This will be only logged once.", |
There was a problem hiding this comment.
One superclass two superclasses no?
|
|
||
| @SuppressWarnings({"resource", "unused"}) | ||
| @RunWith(MockitoJUnitRunner.class) | ||
| @ExtendWith(MockitoExtension.class) |
There was a problem hiding this comment.
import org.junit.jupiter.api.Assertions;
There was a problem hiding this comment.
en fait je pense que tu px ajouter un static import
import static org.junit.jupiter.api.Assertions.assertThrows;
89746ec to
71bdc1b
Compare
Fix the illegal reflective access in favor of an interface. Library bumps across the board.
71bdc1b to
11ff470
Compare
Fix the illegal reflective access in favor of an interface.
Library bumps across the board.