Only invoke Resource's super.close() if the resource is open.#602
Conversation
|
LGTM, thanks, good thinking. Right, I plan to drop JDK 7 support in ClassGraph version 5 (which I will probably work on after there have been no new bug reports for a few months, which the project is approaching). At that point I'll switch the code internally to use lambdas, method references, etc. For now though, with your change in place, I'll probably just pass a reference in to the |
|
OK, thanks. BTW ClassGraph 4.8.135 hasn't appeared in Maven Central yet. Was there a problem during publication? Out of curiosity, will ClassGraph 5 still support JDK8 please? |
|
Yes, the plan is to bump the minimum supported JDK version from 7 to 8 for ClassGraph version 5. JDK 7 support has required quite a lot of workarounds over the years. But JDK 8 will still be important for probably another 5-10 years or something, so I don't want to increase the minimum supported version beyond JDK 8 for a long time. I made the changes, you can look at my commit 220be7b if you are curious. However this does not change functionality in any way, so I won't push out a new release just for this. Thanks again for your code contributions and your ideas! |
I'm not sure what the problem is -- the Sonatype Nexus UI is just hanging, so I suspect Sonatype is broken, and I use Sonatype to publish artifacts to Maven Central. (This sort of thing happens a lot with Sonatype...) https://oss.sonatype.org/#nexus-search;quick~io.github.classgraph |
|
(The Sonatype UI is now responding, a few minutes later. I see that 4.8.135 is not there. I have no idea what happened! I re-tagged this release, including with the latest refactoring changes, and published this release again.) Now 4.8.135 is showing up in Sonatype, so it should be visible in Maven Central within a few hours. |
Protect
Resource'ssuper.close()invocation usingResource.isOpen. This allows us to simplify theonClosehandlers only to invokeResource.close().Maybe one day the
onClosehandler can then be replaced by justResource::close.