RFR: CODETOOLS-7902853: JMH: Fix lint and deprecation warnings

Niels Basjes github.com+240096+nielsbasjes at openjdk.java.net
Tue Mar 23 20:20:55 UTC 2021


On Mon, 15 Mar 2021 19:21:02 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> I did some checks and tests.
>> 
>> I reverted my change (locally) and added `-Werror` to the compiler on the `jmh-core-it` which did not cause the same fail I have.
>> 
>> My best guess at this moment is that it is related to my project using Java 8 and 11, and this project explicitly uses java 1.7.
>> 
>> Also I get a (correct) warning about the usage of `Unsafe` (used to cause a segmentation fault in a test) which I was unsuccessful in suppressing.
>> 
>> Also in all of the three other situations the input field is a `double` that is then cast to a `long`, which seems fine to me.
>
>> My best guess at this moment is that it is related to my project using Java 8 and 11, and this project explicitly uses java 1.7.
> 
> I think it also requires `-Xlint` to be enabled. See this patch, which hooks up `-Xlint` and `-Werror` to JMH compilation tests:
>   https://cr.openjdk.java.net/~shade/jmh/Werror-1.patch 
> 
> Please mix it in to this PR. (Then maybe say `/contributor add @shipilev` here).
> 
>> Also in all of the three other situations the input field is a `double` that is then cast to a `long`, which seems fine to me.
> 
> Yes!

I'll pull that in.
And cleanup some other things I ran into (in separate commits).

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

PR: https://git.openjdk.java.net/jmh/pull/31


More information about the jmh-dev mailing list