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

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

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.5
    • Fix Version/s: 3.3.6, 3.4.1
    • Component/s: server
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: