Re: Annotation scanning with java 9 multi version jars
I've had a conversations regarding this issue on jigsaw-dev and core-libs-dev. While there was some acknowledgement that the JarFile API is incomplete regarding support for Multi Release jars, there was not much enthusiasm taking on the responsibility of filtering out non applicable classes.
Specifically I proposed:
the stream needs to handle inner classes and only include them
and provided a proposed implementation:
to which the response from Alan Bateman at oracle was:
I don't think this should be pushed down to the JarFile API. The JarFile
So if that view prevails, then it is up to the application specification and container developers to agree on a semantic of what classes will be scanned, else we will have a major portability problem. There were several responses in the discussion there that indicated that such problems are already being seen in the wild as libraries are being released using this features in advance of the tools being able to cope.
So it would be really great if we could come up with an agreement on how to apply interpret the "semantic relationships" within a MR Jar.
I think the main driver for my proposal are that: it avoids the need to analyse the class files to determine relationships and applicability; b) it is a likely default layout for MR jars; c) it has defensible semantics.
However, I think it more important that there is an agreed portable interpretation, rather than any one interpretation, so happy to consider other proposals.
On 14 September 2017 at 03:28, Mark Thomas <markt@...> wrote:
On 13/09/2017 01:02, Greg Wilkins wrote: