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

Excise vestigial "int index" field of TimeUnit

    XMLWordPrintable

    Details

      Description

      Doug Lea writes:

      Neal Gafter wrote to me saying

      >> I found this silly code in TimeUnit:
      >>
      >> /**
      >> * The index of this unit. This value is no longer used in this
      >> * version of this class, but is retained for serialization
      >> * compatibility with previous version.
      >> */
      >> private final int index;
      >>
      >> Enums have special serialization machinery. The fields of an enum play no part in

       > serialization or deserialization. I believe this field can simply be removed.

      (1) Howcome I didn't know that?
      (2) Just to double-check, I wrote a test program, and it is true.
      (3) Martin: Can you file a bug? I'll check in the changes.
      (4) Neal: Thanks!

        Attachments

          Activity

            People

            Assignee:
            martin Martin Buchholz
            Reporter:
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: