Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2164

Bytecode's hashCode impl (and its inner classes) can produce hash collisions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.5
    • 3.3.6, 3.4.1
    • server
    • None

    Description

      Looking at the hashCode() implementation of Bytecode.Binding, it can produce hash collisions and therefore should be improved.

      This can be reproduced with:

      
      System.out.println("first = " + new Bytecode.Binding("3", "7").hashCode());
      System.out.println("second = " + new Bytecode.Binding("7", "3").hashCode());
      System.out.println("equal? = " + new Bytecode.Binding("3", "7").equals(new Bytecode.Binding("7", "3")));

      which will print:

      first = 106
      second = 106
      equal? = false

      Attachments

        Issue Links

          Activity

            People

              spmallette Stephen Mallette
              eduard.tudenhoefner Eduard Tudenhoefner
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: