-
Bug
-
Resolution: Fixed
-
P2
-
None
-
None
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JMC-7708 | 8.0.1 | Marcus Hirt | P2 | Resolved | Fixed |
A bunch of JFR Parser struct types (eg. StructTypes.JfrFrame, StructTypes.JfrMethod) are using lazily initialized attributes which happen to be a part of hashCode/equals computations.
The problem is that the hashCode/equals computation does not force the attribute initialization so if someone adds an instance of one of those types to eg. a hashmap before accessing some of its fields via getters the hash code will be different than when it is done after accessing those fields. Also, which fields are accessed makes difference.
The proposed solution is to have guarded initialization of the state necessary for hashCode/equals computations and force init of all required fields there.