Details

    • Sub-task
    • Resolution: Fixed
    • P4
    • 8
    • None
    • core-libs
    • b98
    • Not verified

    Description

      Static interface method is supported in JDK8, many APIs in Comparators can be Comparator static methods.

      It would be nice if the Comparator combinator APIs allows narrowing type, given below example,

      class Person;
      class Employee extends Person;
      class Manager extends Employee;

      Comparator<Person> cmpP;
      Comparator<Employee> cmpE;

      // It would be nice if this statement just work
      Comparator<Manager> c = cmpE.thenComparing(cmpP);
       
      There are also a couple things can be improved or cleanup, not limiting to following list,

      1. Javadoc should have @return tag
      2. Comparators.compose() can be fully replaced by Comparator.thenComparing() if only two comparators are to be composed. Unless to support 2+ combination, there is no add-on value to have this method.

      Attachments

        Activity

          People

            henryjen Henry Jen
            henryjen Henry Jen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: