RFR: JDK-8275308: Add valueOf(Runtime.Version) factory to SourceVersion [v2]
Joe Darcy
darcy at openjdk.java.net
Mon Oct 25 15:50:28 UTC 2021
On Fri, 22 Oct 2021 07:53:44 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:
>
>
> > In the latest push, stubbed in support for the reverse mapping from SourceVersion to a runtime version. For now, limiting the mapping to RELEASE_9 and higher since Runtime.Version was added in 9.
>
> Thanks for adding the reverse mapping! Is there a problem with Source.Version representing a version earlier than 9, other than that it was added in that release? Supporting earlier versions would be very useful for javadoc, where we support versions starting from 7.
Added support back to 6, the release the javax.lang.model API was added. Strictly speaking release 6, 7, and 7 aren't modeled by Runtime.Version, but just using the feature value can be reasonable.
I don't think it is worthwhile to formally map, for instance, RELEASE_5 to something like RuntimeVersion.parse("5.0") or RuntimeVersion.parse("5.0.0") to try to model the versioning scheme used then.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5973
More information about the compiler-dev
mailing list