Class AddSerialVersion


  • public class AddSerialVersion
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  AddSerialVersion.SinkOutputStream
      This class implements a stream that just discards everything written to it.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addSerialVersionUID​(ClassReader r, ClassWriter w)
      This method computes the serialVersionUID for class r (if there isn't one already) and adds the field to the classwriter w.
      static long computeSerialVersionUID​(ClassReader r)
      This method computes the serialVersionUID for class r.
      static void main​(java.lang.String[] args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • addSerialVersionUID

        public static void addSerialVersionUID​(ClassReader r,
                                               ClassWriter w)
                                        throws InvalidClassFileException
        This method computes the serialVersionUID for class r (if there isn't one already) and adds the field to the classwriter w.

        When run as a program, just takes a list of class files as command line arguments and computes their serialVersionUIDs.

        Throws:
        java.lang.IllegalArgumentException - if r is null
        InvalidClassFileException
      • main

        public static void main​(java.lang.String[] args)