[ 
https://issues.apache.org/jira/browse/HBASE-29547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18018626#comment-18018626
 ] 

Istvan Toth commented on HBASE-29547:
-------------------------------------

Thanks, I was planning on doing something similar.
Maybe you can just levae out the setters and keep using reflection to minimize 
the chances of setting them by mistake.
But either one works for me.

> IllegalAccessException: static final field has no write access in tests with 
> Java 21
> ------------------------------------------------------------------------------------
>
>                 Key: HBASE-29547
>                 URL: https://issues.apache.org/jira/browse/HBASE-29547
>             Project: HBase
>          Issue Type: Bug
>          Components: test
>            Reporter: Istvan Toth
>            Assignee: Daniel Roudnitsky
>            Priority: Major
>              Labels: jdk21
>
> Affected tests:
>  * TestByteBufferUtils
>  * TestBytes
>  * TestCompactionToolNpeFix
>  * TestBackupSmallTests
>  * TestRSGroupsKillRS
> {noformat}
> [ERROR]   TestByteBufferUtils.<init>:124->disableUnsafe:100->setUnsafe:92 » 
> Internal java.lang.IllegalAccessException: static final field has no write 
> access: 
> org.apache.hadoop.hbase.util.ByteBufferUtils.UNSAFE_AVAIL/boolean/putStatic, 
> from class java.lang.Object (module java.base)
> [ERROR]   
> TestBytes.testFindCommonPrefix:591->testFindCommonPrefix:600->setUnsafe:66 » 
> Internal java.lang.IllegalAccessException: static final field has no write 
> access: 
> org.apache.hadoop.hbase.util.Bytes.UNSAFE_UNALIGNED/boolean/putStatic, from 
> class java.lang.Object (module java.base)
> [ERROR]   
> TestBytes.testFindCommonPrefixUnsafe:596->testFindCommonPrefix:600->setUnsafe:66
>  » Internal java.lang.IllegalAccessException: static final field has no write 
> access: 
> org.apache.hadoop.hbase.util.Bytes.UNSAFE_UNALIGNED/boolean/putStatic, from 
> class java.lang.Object (module java.base)
> [ERROR]   TestBytes.testShort:75->testShort:84->setUnsafe:66 » Internal 
> java.lang.IllegalAccessException: static final field has no write access: 
> org.apache.hadoop.hbase.util.Bytes.UNSAFE_UNALIGNED/boolean/putStatic, from 
> class java.lang.Object (module java.base)
> [ERROR]   TestBytes.testShortUnsafe:80->testShort:84->setUnsafe:66 » Internal 
> java.lang.IllegalAccessException: static final field has no write access: 
> org.apache.hadoop.hbase.util.Bytes.UNSAFE_UNALIGNED/boolean/putStatic, from 
> class java.lang.Object (module java.base)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to