javaserializationserialversionuid

Do i have to update the serialVersionUID for this change?


If i change this method:

public void setCustom(Map<String, Object> custom) {
    this.custom = (LinkedHashMap<String, Object>)custom;
}

to:

public void setCustom(LinkedHashMap<String, Object> custom) {
    this.custom = custom;
}

do i have to update the serialVersionUID? Is it a compatible change or not?


Solution

  • No, the serialization works with class member variables not with methods. For full list of changes that must be taken into account see here.