RFR - 8132734: java.util.jar.* changes to support multi-release jar files
Alan Bateman
Alan.Bateman at oracle.com
Sat Jan 30 08:00:06 UTC 2016
On 29/01/2016 17:39, Paul Sandoz wrote:
> :
> Alan’s point is that traversing using entries()/stream() always returns the versioned entries (if any) rather than all entries, thus in a sense filters.
>
> My assumption was the traversal should by default be consistent with a calls to getEntry, thus:
>
> jarFile.stream().forEach(e -> {
> JarEntry je = jarFile.getJarEntry(e.getName());
> assert e.equals(je);
> });
>
> There might need to be another stream method that returns all entries.
>
Right, I'm mostly just wondering if entries()/streams() should override
the entries in the stream with versioned entries and filter out the
META-INF/versions/ tree.
If I've gone to trouble of specifying the a Release then it seems the
right thing to do. On the other hand, it comes at a cost and there will
be use-cases like "get the names of all entries" that would be more
efficient to just build on the current entries()/stream(). I'm loath to
suggest this might need a new method but it might be one of the options
to consider here. Minimally there is a javadoc to specify on how these
methods behave when the JAR is multi-release and opened by specifying a
release.
-Alan
More information about the core-libs-dev
mailing list