我是否必须为此更改更新 serialVersionUID?
Do i have to update the serialVersionUID for this change?
如果我改变这个方法:
public void setCustom(Map<String, Object> custom) {
this.custom = (LinkedHashMap<String, Object>)custom;
}
至:
public void setCustom(LinkedHashMap<String, Object> custom) {
this.custom = custom;
}
我必须更新 serialVersionUID 吗?是否兼容更改?
不,序列化适用于 class 成员变量,不适用于方法。
有关必须考虑的更改的完整列表,请参阅 here。
如果我改变这个方法:
public void setCustom(Map<String, Object> custom) {
this.custom = (LinkedHashMap<String, Object>)custom;
}
至:
public void setCustom(LinkedHashMap<String, Object> custom) {
this.custom = custom;
}
我必须更新 serialVersionUID 吗?是否兼容更改?
不,序列化适用于 class 成员变量,不适用于方法。 有关必须考虑的更改的完整列表,请参阅 here。