SourceVersion::feature

Michael Bien mbien42 at gmail.com
Sat Oct 9 18:58:20 UTC 2021


Hello,

could javax.lang.model.SourceVersion receive a feature() method 
returning the version as an int, analog to java.lang.Runtime.Version?

if (SourceVersion.latest().feature() >= 18) {}

is simpler than comparing enums which may or may not exist dependent on 
the deployed java version and cleaner than ordinal() tricks.

best regards,

michael



More information about the core-libs-dev mailing list