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

TypeError when a java.util.Comparator object is invoked as a function

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 9
    • 9
    • core-libs
    • None
    • b121
    • generic
    • generic

    Backports

      Description

        Nashorn supports calling FunctionalInterface interface objects to be treated like functions. This fails for java.util.Comparator objects:

        jjs> f = java.util.Comparator.reverseOrder()
        java.util.Collections$ReverseComparator@6283d8b8
        jjs> f.compare(343, 55)
        -1
        jjs> f(343, 55)
        <shell>:1 TypeError: java.util.Collections$ReverseComparator@6283d8b8 has no suc
        h function "equals"

        Attachments

          Issue Links

            Activity

              People

                sundar Sundararajan Athijegannathan
                sundar Sundararajan Athijegannathan
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: