Construct JarFileUrlKey directly from already-parsed URL specification
to avoid unnecessary URL construction and parsing on cache hits.
A URL is only created on a cache miss when the JarFile needs to be
instantiated.
This eliminates redundant object allocation in the hot path when
frameworks probe for optional classes or package-info metadata across
a large executable JAR.
See gh-51827
Signed-off-by: sharanrenukeshbharmshetty <sbharmshetty@gmail.com>
Update `NestedJarFileResources` to fix a race condition that could
result in a `NullPointerException`.
The methods `getOrCreateInflater` and `endOrCacheInflater` both
synchronize on a local `inflaterCache` variable but attempted to use the
`this.inflaterCache` instance which could be set to null.
The `releaseInflators` method had a synchronized block for ending each
inflater but the cache was being nulled out outside the block meaning that
the other 2 methods mentioned could hit the race condition.
Signed-off-by: Ian Kettle <25729118+icikle@users.noreply.github.com>
See gh-51744