Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-4804

Static forwarders are missing after adding @SerialVersionUID

    Details

      Description

      In the following code, adding @SerialVersionUID to the class results in the static forwarders missing from the byte code.

      object WithoutUID {
       val instance = new WithoutUID
      }
      class WithoutUID extends scala.Serializable
       
      object WithUID {
       val instance = new WithUID
      }
      @SerialVersionUID(0) 
      class WithUID extends scala.Serializable

      Here is the relevant decompiled byte code:

      public class WithoutUID implements Serializable, ScalaObject {
        public static final WithoutUID instance(){
          return WithoutUID.MODULE$.instance();
        }
      }
       
      public class WithUID implements Serializable, ScalaObject {
        public static final long serialVersionUID = 0L;
      }

        Attachments

          Activity

            People

            • Assignee:
              magarcia Miguel Garcia
              Reporter:
              joshcough Josh Cough
            • Votes:
              2 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: