RFR: 6692: JMC is asking to unlock Commercial Features on JFR enabled OpenJDK8

Marcus Hirt hirt at openjdk.java.net
Thu Feb 13 22:23:49 UTC 2020


On Thu, 13 Feb 2020 19:47:52 GMT, Alex Macdonald <aptmac at openjdk.org> wrote:

> This pull request addresses JMC-6692 [[0]](https://bugs.openjdk.java.net/browse/JMC-6692), in which JMC will ask to unlock commercial features when trying to use Flight Recorder on a JFR-enabled OpenJDK 8.
> 
> The most important change here is the check on `java.vm.vendor` to `java.vm.name`, because the vendor string for Oracle and OpenJDK JVMs are the same. Now it's checking specifically if the name is `Java HotSpot` when determining `isOracle()`.
> 
> The patch for including JFR into OpenJDK 8 also allows for a flag to be set when configuring the build which prevents JFR from being enabled (i.e., `-XX:+FlightRecorder` will not turn it on). This causes a problem because `JVMSupportToolkit.isFlightRecorderDisabled()` will throw an exception when looking up the value of that flag on JFR-disabled OpenJDK 8, causing it to return `false`. This results in the `StartRecordingAction` opening the commercial features wizard/dialog because it thinks that JFR is available but not disabled via the VM option, but in reality its disabled from the build. I've added a function (`hasFlightRecorder()`) to the `JVMSupportToolkit` that returns true only if it's an Oracle JDK or if the VM option exists.
> 
> I've verified this with Oracle JDK (1.8.0_241), my Fedora `dnf install`-ed OpenJDK 8, OpenJDK 8u-dev builds with both `--disable-jfr` and `--enable-jfr`, and publicly downloadable (at your own risk) jfr-enabled builds from [builds.shipilev.net](https://builds.shipilev.net/ )  [1].
> 
> Additionally, does anyone know where I can find valid Japanese and Chinese translations for the updated dialog message? FWIW the Japanese one doesn't mention OpenJDK 11+, so it hasn't been updated in a while.
> 
> [0] https://bugs.openjdk.java.net/browse/JMC-6692
> [1] https://builds.shipilev.net/openjdk-jdk8-jfr/
> 
> After: Oracle JDK 1.8.0_241 (pressing yes does enable JFR)
> ![after-oracle](https://user-images.githubusercontent.com/10425301/74469883-78994800-4e6b-11ea-9308-6d309693e015.png)
> 
> After: OpenJDK 8 with JFR disabled in the build
> ![after-disabled](https://user-images.githubusercontent.com/10425301/74469894-7afba200-4e6b-11ea-85c9-5e290bda0c54.png)
> 
> After: OpenJDK 8 with JFR enabled in the build
> ![after-enabled](https://user-images.githubusercontent.com/10425301/74469895-7b943880-4e6b-11ea-98bb-409970cf5dfa.png)

Marked as reviewed by hirt (Lead).

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

PR: https://git.openjdk.java.net/jmc/pull/53


More information about the jmc-dev mailing list