#598 RedundateModifier if transient on static or final field

open
nobody
Check (274)
5
2014-10-21
2012-04-17
Daniel Holmes
No

transient on a static or final field is essentially meaningless.

http://www.xyzws.com/Javafaq/can-transient-variables-be-declared-as-final-or-static/0

Surprisingly, the java compiler does not complaint if you declare a static member field as transient or a final member field as transient in your classes. These should be compile-time errors. Because a "transient" part of an object's state is assumed to be changing within each instance, it can not be static or final.

Discussion