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

Inferred lub contains two classes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 6
    • 5.0
    • tools
    • generic
    • generic

      import java.util.*;
       
      interface I {}
      class A1 {}
      class B1 extends A1 implements I {
          B1() {}
      }
      class B2 extends A1 implements I {
          B2() {}
      }
       
      class Cell<V>
      {
       V value;
       <T extends V> Cell(T a) {value = a;}
       V get() { return value; }
      }
       
      class Foo {
          void test(boolean b){
           Cell<? extends B1> cb1 = new Cell<B1>(new B1());
           Cell<? extends B2> cb2 = new Cell<B2>(new B2());
           Cell<? extends I> c1 = ( b ? cb1 : cb2);
           Cell<? extends A1> c2 = ( b ? cb1 : cb2);
           
       }
      }

      See http://forum.java.sun.com/thread.jspa?threadID=632049&tstart=0

      ###@###.### 2005-06-01 14:40:03 GMT

            ahe Peter Ahe
            ahe Peter Ahe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: