Bug 541210 - Replace uses of java.lang.reflect with java.lang.invoke
Summary: Replace uses of java.lang.reflect with java.lang.invoke
Status: NEW
Alias: None
Product: Epsilon
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Sina Madani CLA
QA Contact:
URL:
Whiteboard:
Keywords: api, performance
Depends on:
Blocks:
 
Reported: 2018-11-15 13:27 EST by Sina Madani CLA
Modified: 2018-11-15 13:27 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sina Madani CLA 2018-11-15 13:27:49 EST
The "newer" (introduced in Java 7, 2011) MethodHandles API is preferable to reflection for performance and should be used in Epsilon where possible. This is especially the case in light of the lambda support added recently, which still uses reflection and consequently suffers from illegal reflective access.
It would also be worth consider replacing Fields with VarHandle (introduced in Java 9, 2017) when moving to Java 11 and beyond.

These changes should mostly affect ReflectionUtil, org.eclipse.epsilon.eol.execute.introspection.java and OperationContributor.