Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-321

ComparableComparator.getInstance() not compilable with jdk-compiler

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0-alpha1, 4.0
    • Comparator
    • None

    Description

      Comparator<Integer> c = ComparableComparator.getInstance();

      This line is valid with eclipse (3.4) compiler, but the jdk 1.5.0 compiler returns this error:
      [javac] J:\workspace\ndt\cobolclipse-TRUNK\collections_jdk5_branch\src\java\org\apache\commons\collections\comparators\ComparableComparatorTest.java:23: incompatible types; no instance(s) of type variable(s) E exist so that org.apache.commons.collections.comparators.ComparableComparator<E> conforms to java.util.Comparator<java.lang.Integer>
      [javac] found : <E>org.apache.commons.collections.comparators.ComparableComparator<E>
      [javac] required: java.util.Comparator<java.lang.Integer>
      [javac] Comparator<Integer> c = ComparableComparator.getInstance();
      [javac] ^
      [javac] 1 error

      Attachments

        Activity

          People

            Unassigned Unassigned
            daniel.golesny Daniel Golesny
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: