SerialVersionUIDAdder issues
We are using a custom version of SerialVersionUIDAdder. The issues with the
original are the following:
1) serialVersionUID should be 0L for enums:
http://docs.oracle.com/javase/6/docs/platform/serialization/spec/serial-arch.html#6469
> Similarly, any serialPersistentFields or serialVersionUID field declarations
are also ignored--all enum types have a fixed serialVersionUID of 0L
But with ASM it will be a number.
Javas util "serialver" gives a 0L for serialVersionUID.
2) serialVersionUID should be computed to interfaces because interfaces can
have a serialVersionUID field.
"serialver" gives a default serialVersionUID.
2*) When computing serialVersionUID for an interface with 0 methods. Then the
class should be counted as non-abstract, this can be checked by comparing
results with "serialver".
In code:
visit(...):
computeSVUID = (access & Opcodes.ACC_INTERFACE) == 0;
->
computeSVUID = (access & Opcodes.ACC_ENUM) == 0;
computeSVUID():
before dos.writeInt
int access = this.access;
if ((access & Opcodes.ACC_INTERFACE) != 0)
access = (svuidMethods.size() > 0) ? (access | Opcodes.ACC_ABSTRACT) : (access
& ~Opcodes.ACC_ABSTRACT);