`FieldProbe`s should make use of `VarHandle`s
Once the type system is enriched with the other primitive types, you can use a VarHandle and use the same technique to prevent litter as with the MethodProbe.
Originally posted by @pveentjer in https://github.com/hazelcast/hazelcast/pull/25279#discussion_r1336138919
Basic implementation started, but performs slower (4.2 vs 1.7ns) than the current reflection implementation.
Raised on Stackoverflow.
After further investigation, I'm not sure that VarHandles on their own are a good idea without additional supporting frameworks due to performance concerns.
An alternative solution to non-static-final VarHandle slowness would be to add -XX:+TrustFinalNonStaticFields (unrealistic for production) or to keep the var handle in records (not applicable to your usage too), just in case you are interested. https://shipilev.net/jvm/anatomy-quarks/17-trust-nonstatic-final-fields/ https://minborgsjavapot.blogspot.com/2023/09/java-records-are-trusted-and.html