ItEr20S04ArquitecturaServidorItEr19S04: Copying collection properties instead of returning them directly.
This prevents modifications on the collections properties from outside of the entity.
This commit is contained in:
parent
118b5a1ef3
commit
c183170dda
3 changed files with 5 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package org.navalplanner.business.advance.entities;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.navalplanner.business.common.BaseEntity;
|
||||
|
|
@ -62,6 +63,6 @@ public class AdvanceAssigment extends BaseEntity {
|
|||
}
|
||||
|
||||
public Set<AdvanceMeasurement> getAdvanceMeasurements() {
|
||||
return this.advanceMeasurements;
|
||||
return new HashSet<AdvanceMeasurement>(this.advanceMeasurements);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class WorkReportLine extends BaseEntity {
|
|||
}
|
||||
|
||||
public Set<Criterion> getCriterions() {
|
||||
return criterions;
|
||||
return new HashSet<Criterion>(criterions);
|
||||
}
|
||||
|
||||
public void setCriterions(Set<Criterion> criterions) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.navalplanner.business.workreports.entities;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.navalplanner.business.common.BaseEntity;
|
||||
|
|
@ -33,7 +34,7 @@ public class WorkReportType extends BaseEntity {
|
|||
}
|
||||
|
||||
public Set<CriterionType> getCriterionTypes() {
|
||||
return criterionTypes;
|
||||
return new HashSet<CriterionType>(criterionTypes);
|
||||
}
|
||||
|
||||
public void setCriterionTypes(Set<CriterionType> criterionTypes) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue