Uploaded image for project: 'Java Mission Control'
  1. Java Mission Control
  2. JMC-7349

JFR Parser struct types hashcode is not stable

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.1.0
    • Component/s: Mission Control Core
    • Labels:
      None
    • Subcomponent:
    • Sprint:
      JMC 8.1 RDP2 1, JMC 8.1 RDP2 Final

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jbachorik Jaroslav Bachorík
              Reporter:
              jbachorik Jaroslav Bachorík
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: