Fix VerifyError on some environments #1
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I load
pogonos.reader
in the Clojure CLI REPL on JVM 14, I run into aVerifyError
like the following:The same goes for Clojure CLI on JVM 8 and
lein repl
on JVM 14, but NOT forlein repl
on JVM 8.I'm not really sure what is exactly causing this (maybe the difference of classloaders and/or some change in the bytecode verification logic matters?), but after digging into it for a while, I figured out this happens if the reader impls implement
java.io.Closeable#close()
(which overloadspogonos.protocols/IReader#close()
).My first design decision for making the readers implement
java.io.Closeable
was just for the user's convenience. Now, however, I don't think It's worthwhile to do so because:pogonos.protocols/IReader#close()
instead ofjava.io.Closeable#close()
So, this PR removes the
java.io.Closeable
implementation from the readers to work around theVerifyError
. This really is a breaking change, but its impact won't be so significant for the reasons above.