Bug 1532

Summary: UnsafeUtil: Remove usage of deprecated field `sun.misc.Unsafe::objectFieldOffset` (JDK 24 warning)
Product: [JogAmp] Gluegen Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: 2.6.0   
Hardware: All   
OS: all   
Type: FEATURE SCM Refs:
gluegen 24e6a89e203f61dfbbdea7425a920b53595881f5 jocl 6d9649249b40e1ac880288bbad144649170092df
Workaround: ---
Bug Depends on: 1523    
Bug Blocks:    

Description Sven Gothel 2025-08-30 11:54:40 CEST
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.jogamp.common.util.UnsafeUtil$1 (file:/usr/local/projects/JogAmp/gluegen/build-macosx/gluegen-rt.jar)
WARNING: Please consider reporting this to the maintainers of class com.jogamp.common.util.UnsafeUtil$1
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

+++

Usage of this field was introduced in commit 303a6701c2b643d5579a5b88a101a53ccba9f90c
for Bug 1523.

This also implies removing `addressFieldOffset` 
and hence `getDirectBufferAddress` method,
as it uses the `objectFieldOffset` method to fetch the field.

Users shall simply use `Buffers.getDirectBufferAddress(niobuffer);`
Comment 1 Sven Gothel 2025-08-30 11:58:51 CEST
resolved as described