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

      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.

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

              Created:
              Updated:
              Resolved: