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

Legal cast rejected

XMLWordPrintable

    • generic
    • generic

      This program doesn't compile:

      import java.lang.ref.*;
       
      public class CastProb {
       
        public ExtraRef prob(ReferenceQueue<Object> refQ) {
          return((ExtraRef)refQ.remove());
        }
       
        public static class ExtraRef
          extends WeakReference<Object> {
       
          int extraInfo;
       
          public ExtraRef(Object value) {
            super(value);
          }
        }
      }

      See http://forum.java.sun.com/thread.jspa?threadID=618527

      ###@###.### 2005-04-18 19:15:37 GMT

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: