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

Inferred lub contains two classes

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: 6
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: