tg
tg copied to clipboard
Reflection with Method Handles
Description
Reflection is used extensively in TG. And so its speed and safety is important. This issue should be used in researching the subject of Method Handles as a better way to do reflection in modern Java.
As a working example, dynamic property assignment and access should be modified to use Method Handles. More specifically, methods AbstractEntity.get and AbstractEntity.set should be reimplemented using Method Handles. It is important to consider inherited properties, overridden setters and getters, protected setters.
Resources
- https://blogs.oracle.com/javamagazine/post/java-reflection-method-handles
Expected outcome
Safer and faster reflection in TG.