[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-core-libs-dev
Subject:    Re: RFR - 8132734: java.util.jar.* changes to support multi-release jar files
From:       Alan Bateman <Alan.Bateman () oracle ! com>
Date:       2016-01-30 8:00:06
Message-ID: 56AC6D86.7050101 () oracle ! com
[Download RAW message or body]


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic