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

compilation mismatch between javac 8 source 7 and javac 7 source 7

    XMLWordPrintable

    Details

      Description

      The following code:

      import java.util.Comparator;

      class GenericMethod {
           <E extends Comparable<E>> Comparator<E> getComparator() {
               return null;
           }

           <E> void useComparator(Comparator<? super E> comparator) {
           }

           void test() {
               useComparator(this.getComparator());
           }
      }

      Compiles with javac8 -target 7 but fails to compile with javac7 target 7.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vromero Vicente Arturo Romero Zaldivar
              Reporter:
              vromero Vicente Arturo Romero Zaldivar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: