...
When defensive copying is necessary, make the defensive copies before parameter validation; validate the copies rather than the original parameters. ( See guideline SER07-J. Make defensive copies of private mutable components for additional information.)
Noncompliant Code Example
...