[
https://issues.apache.org/jira/browse/BCEL-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary D. Gregory resolved BCEL-376.
----------------------------------
Fix Version/s: 6.10.1
Assignee: Gary D. Gregory
Resolution: Fixed
[[email protected]]
Thank you for your report. This is now fixed in git master [1] and snapshot
builds [2]
[1]
https://github.com/apache/commons-bcel/commit/5cf9151a99ca5a123a6ef1157fd3a68842b5da9a
[2] https://repository.apache.org/content/repositories/snapshots/
> ClassPath.close() throws UnsupportedOperationException when created with
> system-classpath
> -----------------------------------------------------------------------------------------
>
> Key: BCEL-376
> URL: https://issues.apache.org/jira/browse/BCEL-376
> Project: Commons BCEL
> Issue Type: Bug
> Components: Parser
> Affects Versions: 6.10.0
> Reporter: Dominik Stadler
> Assignee: Gary D. Gregory
> Priority: Major
> Fix For: 6.10.1
>
>
> When instantiating {{ClassPath}} with {{{}ClassPath.getClassPath(){}}}, a
> {{UnsupportOperationException}} is thrown:
> {code:java}
> java.lang.UnsupportedOperationException
> at
> java.base/jdk.internal.jrtfs.JrtFileSystem.close(JrtFileSystem.java:104)
> at
> org.apache.bcel.util.ModularRuntimeImage.close(ModularRuntimeImage.java:83)
> at org.apache.bcel.util.ClassPath$JrtModules.close(ClassPath.java:373)
> at org.apache.bcel.util.ClassPath.close(ClassPath.java:576)
> at TestBCEL.testClose(TestBCEL.java:35){code}
>
> The following test-case can be used to reproduce this:
>
> {code:java}
> @Test
> void testClose() throws IOException {
> try (ClassPath cp = new ClassPath(ClassPath.getClassPath())) {
> assertNotNull(cp);
> }
> } {code}
>
> It seems some Java filesystems will throw this, maybe the exception needs to
> be caught and ignored in {{{}ClassPath$JrtModules.close(){}}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)