On Thu, 5 Jan 2023 12:18:58 GMT, Per Minborg <pminb...@openjdk.org> wrote:

>> Currently, `java.io.Bits` is using explicit logic to read/write various 
>> primitive types to/from byte arrays. Switching to the use of `VarHandle` 
>> access would provide better performance and less code. 
>> 
>> Also, using a standard API for these conversions means future `VarHandle` 
>> improvements will benefit `Bits` too. 
>> 
>> Improvements in `Bits` will propagate to `ObjectInputStream`, 
>> `ObjectOutputStream` and `RandomAccessFile`.
>> 
>> Initial benchmarks and performance discussions can be found here: 
>> https://github.com/openjdk/panama-foreign/pull/762
>
> Per Minborg has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Use canonical NaN values also for read

test/jdk/java/io/Bits/ReadWriteValues.java line 29:

> 27:  * @compile/module=java.base java/io/BitsProxy.java
> 28:  * @run junit/othervm --add-opens java.base/java.io=ALL-UNNAMED 
> ReadWriteValues
> 29:  */

I see you've figured out to test with a helper classes in java.io, good! 

Did you mean to add a test tag to BitsProxy? That will cause jtreg to treat it 
as a test in its own right and it will fail.

For ReadWriteValues, the --add-opens isn't needed as the test no longer does 
any deep reflection on APIs in that package. You can add a bug tag too, which 
should give you:


/*
 * @test
 * @bug 8299576
 * @summary Verify that reads and writes of primitives are correct
 * @compile/module=java.base java/io/BitsProxy.java
 * @run junit ReadWriteValues
 */

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

PR: https://git.openjdk.org/jdk/pull/11840

Reply via email to