RFR: JDK-8275308: Add valueOf(Runtime.Version) factory to SourceVersion [v3]

Joe Darcy darcy at openjdk.java.net
Wed Oct 27 20:45:14 UTC 2021


On Wed, 27 Oct 2021 17:05:54 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>>> 
>>> 
>>> Using `Runtime.version()` as a stand-in for the max `SourceVersion` seems non-obvious. Would it be better to use `SourceVersion.latest().runtimeVersion()` instead?
>>> 
>>> What about when running this API on JDK N-1?
>> 
>> Updated the supported range to go up to the feature corresponding to SourceVersion.latest().
>
> I think this affects the doc comment and CSR.

Right; I think the the current spec

     * ... If the runtime version's {@linkplain
     * Runtime.Version#feature() feature} is greater than the feature
     * of the {@linkplain #runtimeVersion() runtime version} of the
     * {@linkplain #latest() latest source version}, an {@code
     * IllegalArgumentException} is thrown.

does reflect that.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5973


More information about the compiler-dev mailing list