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

Specialized functions with same weight replace each other in TreeSet

XMLWordPrintable

    • b112
    • generic
    • generic
    • Not verified

      Because CompiledFunctions extends TreeSet to store specialized functions and CompiledFunction only uses its method type weight to implement Comparable.compareTo(), a CompiledFunction will replace any other CompiledFunction with the same weight present in the TreeSet.

      To allow storing multiple functions with the same weight (e.g. (int,int) and (double)) compareTo() needs to be consistent with equals(), i.e. it must only return 0 if objects are equal.

            hannesw Hannes Wallnoefer
            hannesw Hannes Wallnoefer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: