Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stronger encapsulation of collection fields in
MavenProject
with im…
…mutability and defensive copies. The following rules are applied in this commit (the previous situation was a mix of different practices): * All getter methods except `getDependencyArtifacts()` return an empty collection instead of null. * All setter methods except delegates make a defensive copy of the given collection, preserving order. * All getter methods returns an unmodifiable (but not necessarily immutable) collection. * The collections of properties that do not have an `addFoo(…)` method are immutable. * The `clone()` method copies all non-immutable collections, and only them. * `MavenProject(MavenProject)` assigns fields directly without invoking setter methods.
- Loading branch information