Closed TWiStErRob closed 9 months ago
Hi @TWiStErRob
I think the NoSuchFieldError can no longer occur and it makes no sense to check for it. As for the compiler not complaining, it is a good question but beyond the scope of SLF4J. :relaxed:
See edit: Error
is not a checked exception.
Unreachable code removed in commit 5ccbe20b118828f35fd64a887d77fb9b72ad1a6e
While reading slf4j2 code to figure out how ~bindings~providers work, I came across a line that confused me:
catch(NoSuchFieldError)
inLoggerFactory
https://github.com/qos-ch/slf4j/blob/216459e5d81c3b066748c51a4eabcda32395fe05/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java#L364-L388
I was wondering why the comment references
REQUESTED_API_VERSION
, while there's no such thing in thetry
.I found the change that invalidated that
catch
, and ~I'm still baffled as to why Java does not complain about a checked exception being not used~ I see why javac didn't alert: it's anError
, not checked!.