RFR: JDK-8196618: Create API to list supported values for javac --release option
Stuart Marks
stuart.marks at oracle.com
Thu Jun 7 22:53:42 UTC 2018
Hi Jan,
Thanks for looking at jdeprscan. This is very timely. Michel was "bugging" me
about some JDK 11 bugs (which are in jdeprscan) and I was looking at them, and I
thought, I need to ask Jan about how to get the set of supported release values.
And here we are!
In jdeprscan/Main.java there's a bit of ad-hoc logic to determine whether a
particular release is modular and whether it has the Java EE modules. Offhand I
can't think of a better way to do this, but maybe this is something we can put
in the back of our heads and think about a bit.
For the help message, it turns out that String.join() consumes an Iterable, so
you can probably just do something like
String supportedReleases = String.join("|", pp.getSupportedPlatformNames());
instead of creating a Stream.
For jdeprscan/TestRelease.java, why not just iterate over all supported platform
names, calling invoke() on each one? I'm not sure what the filtering and
"minimal coverage" logic is supposed to accomplish. If they're not in the set of
supported platforms, forcing "9" and "10" seems likely to create an error. And
we still want to test the old, non-modular releases.
Note further that TestRelease.java is currently on the problem list, so it's not
getting run at the moment. I'm ok if you go ahead with those changes, as it
doesn't matter much. I'll need to revisit this test at some point anyway.
s'marks
On 6/6/18 5:27 AM, Jan Lahoda wrote:
> Hi,
>
> This enhancement requests that test need to be able to query the list of
> supported --release options. This is possible using the JDKPlatformProvider, so
> I updated two tests where this seemed useful. But while doing this, it turned
> out the jdeprscan was not yet fully updated to JDK 11 (still refers to
> java.se.ee and did not list 11 in the help text for the --release option), so I
> updated that as well.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8196618
> Webrev: http://cr.openjdk.java.net/~jlahoda/8196618/webrev.00/
>
> How does this look?
>
> Thanks,
> Jan
>
More information about the compiler-dev
mailing list