8028027: serialver should emit declaration with the 'private' modifier
Yuri Gaevsky
ygaevsky at azulsystems.com
Fri Nov 8 12:11:18 UTC 2013
>> Unfortunately, several Java SE interfaces have public SVUIDs, so the fix can cause confusion:
> I think Stuart's suggestion is good for the case where the class doesn't have the serialVersionUID already, you just paste it into the source code to keep the value as it was generated previously.
Fully agree.
> I think your concern is where the serialVersionUID is declared but hasn't following the recommendation. In that case then the emitted source line won't match the existing source declaration. Does that matter? I guess serialver should use reflection to get the modifiers and print a helpful suggestion.
Well, it would be more consistent to check for existence of protected or public serialVersionUID with Reflection API and change the serialver output accordingly.
Thanks,
-Yuri
More information about the core-libs-dev
mailing list