ItEr57S04ValidacionEProbasFuncionaisItEr56S04: [Bug #499] Compare by id instead of == on adding dependencies.
The former code to add dependencies provokes error when one of the LimitingResourceQueueElement in which a depencency is going to be added (as origin or as destiny) is a proxy (although it has been initialized).
This commit is contained in:
parent
28844f8b5f
commit
46600cbc8b
1 changed files with 2 additions and 2 deletions
|
|
@ -169,9 +169,9 @@ public class LimitingResourceQueueElement extends BaseEntity {
|
|||
|
||||
public void add(LimitingResourceQueueDependency d) {
|
||||
Validate.notNull(d);
|
||||
if (d.getHasAsOrigin().equals(this)) {
|
||||
if (d.getHasAsOrigin().getId().equals(this.getId())) {
|
||||
dependenciesAsOrigin.add(d);
|
||||
} else if (d.getHasAsDestiny().equals(this)) {
|
||||
} else if (d.getHasAsDestiny().getId().equals(this.getId())) {
|
||||
dependenciesAsDestiny.add(d);
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue