RFR: JDK-8275308: Add valueOf(Runtime.Version) factory to SourceVersion [v2]
Michael Bien
duke at openjdk.java.net
Sat Oct 16 16:14:52 UTC 2021
On Sat, 16 Oct 2021 03:23:07 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:
>> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix typo.
>
> Would it help to have a method that provides the inverse mapping
>
>
> Runtime.Version SourceVersion.toRuntimeVersion()
@jonathan-gibbons I think that would help indeed. The conversion method would always be able to return a runtime version without throwing exceptions, which would make it a convenient way to access the feature version int. It seems to be also forward compatible to all (prob. unlikely) scenarios of SourceVersion adding non-feature-version enums.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5973
More information about the compiler-dev
mailing list