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

method type variable: inference broken for null

XMLWordPrintable

    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.5.0_03"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
      Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      This program does not compile:

      public class Try {
      void m() {
      java.util.Collections.max(null);
      }
      }

      incompatible types; inferred type argument(s) java.lang.Comparable<? super T> do not conform to bounds of type variable(s) T
      found : <T>T
      required: java.lang.Object
      java.util.Collections.max(null);
                                               ^
      1 error


      REPRODUCIBILITY :
      This bug can be reproduced always.
      ###@###.### 2005-07-20 09:52:48 GMT

            ahe Peter Ahe
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: