...
This compliant solution ensures that the Foo
object is immutable by removing the setter method and declaring the Date
field as final
. The Date
object can be safely published as a result.
Code Block | ||
---|---|---|
| ||
public class Foo {
public final Date d;
public Foo() {
d = new Date();
}
public Date getDate() {
return d.clone();
}
}
|
Risk Assessment
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
CON26- J | medium | probable | medium | P12 | L1 |
...