EsotericSoftware / reflectasm

High performance Java reflection
BSD 3-Clause "New" or "Revised" License
1.53k stars 222 forks source link

why FieldAccess can't get private Field? #74

Closed q158467234 closed 5 years ago

q158467234 commented 5 years ago

how to get private Field by FieldAccess? I want to use FieldAccess to copyProperties replace spring.BeanUilts

NathanSweet commented 5 years ago

The JVM disallows private field access at the bytecode level. You'll need to use reflection and setAccessible.