Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8256930

About JDK 8 {@code HashMap.checkInvariants()}

    XMLWordPrintable

    Details

      Description

      A DESCRIPTION OF THE PROBLEM :
      The method uses {@ code if (t.red && tl != null && tl.red && tr != null && tr.red) Return false;} to verify the Rb-tree is not rigorous enough?
      When t is a red node, tl is a red node, tr is a black node, or tl is a black node, and tr is a red node, this check will pass, but it should not be a Rb-tree.
      Therefore, I think the check logic of this section is changed to {@ code if (t.red && ((tl != null && tl.red) || (tr != null && tr.red))) return false;} is more rigorous.


        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: