Why is this an issue?
transient
is used to mark fields in a Serializable
class which will not be written out to file (or stream). In a class
that does not implement Serializable
, this modifier is simply wasted keystrokes, and should be removed.
Noncompliant code example
class Vegetable { // does not implement Serializable
private transient Season ripe; // Noncompliant
// ...
}
Compliant solution
class Vegetable {
private Season ripe;
// ...
}