Commit d84ef1a4 authored by Marco Volpe's avatar Marco Volpe
Browse files

Fixed a problem in finding the corresponding ResourceSchedule

* Comparison based on the IDs of the resource and not on the equals()
method.

Issue-Ref: 3817
Issue-Url: https://af3-developer.fortiss.org/issues/3817

Signed-off-by: Marco Volpe's avatarMarco Volpe <volpe@fortiss.org>
parent a108b91f
AF3ScheduleModelElementFactory.java 980a4dcf240aca7294173c150c4a6aba7285b8dd GREEN
MathUtils.java b0be33b10e697504e73e1b5693c36f9c34ddca6f GREEN
ScheduleUtils.java 9d645b67e1379e6ed246fb7679138ff62c5c3282 GREEN
ScheduleUtils.java ce6dae1128b5e50ffca02c4e64dbc7b9b7222876 YELLOW
......@@ -50,6 +50,7 @@ import org.fortiss.af3.schedule.model.SystemSchedule;
import org.fortiss.af3.schedule.model.TimeTrigger;
import org.fortiss.af3.schedule.model.Trigger;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.kernel.model.IIdLabeled;
import org.fortiss.tooling.kernel.model.INamedElement;
/**
......@@ -607,8 +608,9 @@ public class ScheduleUtils {
public static ResourceSchedule getResourceSchedule(List<ResourceSchedule> scheduleList,
IPlatformResource modelElement) {
for(Schedule schedule : scheduleList) {
if((schedule instanceof ResourceSchedule) &&
((ResourceSchedule)schedule).getResource().equals(modelElement)) {
if(schedule instanceof ResourceSchedule &&
(((IIdLabeled)(((ResourceSchedule)schedule).getResource()))
.getId() == ((IIdLabeled)modelElement).getId())) {
return (ResourceSchedule)schedule;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment