]
Pedro Ruivo updated ISPN-6061:
------------------------------
Status: Pull Request Sent (was: Open)
Git Pull Request:
Cache Enum.values()
-------------------
Key: ISPN-6061
URL:
https://issues.jboss.org/browse/ISPN-6061
Project: Infinispan
Issue Type: Enhancement
Components: Core
Affects Versions: 8.0.2.Final
Reporter: Pedro Ruivo
Assignee: Pedro Ruivo
Fix For: 8.2.0.Alpha1
For safety reason, Enum.values() clones the values array in each invocation. Although the
cloning is fast, it creates a lot of garbage (as it is used in every Enum unmarshalling).
Cache it avoids cloning it every time.