javac treats Serializable specially

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • None
    • Affects Version/s: 1.1.7
    • Component/s: tools
    • generic
    • generic



      Name: js5519 Date: 02/19/99


      javac happily compiles the following class.
      In some ways it appears to behave as if
      (but not quite) Object implemented Serializable.
      Maybe I'm just missing something and this is
      correct behavior, but I can't find any justificatio
      for it in either the Language spec or the Serialization
      spec.

      -------------------

      import java.io.Serializable;

      class Wendy {
        
        void f(Serializable s) { }

        void g() {
          Jerry[] j = new Jerry[1];
          f(j);
          Jerry xj = new Jerry();
          f(xj);
          Stratium[] s = new Stratium[2];
          f(s);
          Stratium xs = new Stratium();
          f((Serializable)xs) ;
          int i = 0;
          //f((Serializable)i);
        }
      }

      class Jerry implements Serializable { }

      class Stratium { }
      (Review ID: 41608)
      ======================================================================

            Assignee:
            William Maddox (Inactive)
            Reporter:
            J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: