|
14 | 14 | import com.powsybl.ws.commons.computation.service.NotificationService;
|
15 | 15 | import com.powsybl.ws.commons.computation.service.UuidGeneratorService;
|
16 | 16 | import com.powsybl.ws.commons.computation.utils.FilterUtils;
|
17 |
| -import org.apache.commons.collections4.CollectionUtils; |
18 | 17 | import org.gridsuite.voltageinit.server.dto.BusVoltage;
|
19 | 18 | import org.gridsuite.voltageinit.server.dto.ReactiveSlack;
|
20 | 19 | import org.gridsuite.voltageinit.server.dto.VoltageInitResult;
|
@@ -92,11 +91,11 @@ private static VoltageInitResult fromEntity(VoltageInitResultEntity resultEntity
|
92 | 91 | .sorted(Map.Entry.comparingByKey(String.CASE_INSENSITIVE_ORDER))
|
93 | 92 | .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (collisionValue1, collisionValue2) -> collisionValue1, LinkedHashMap::new));
|
94 | 93 | List<ReactiveSlack> reactiveSlacks = resultEntity.getReactiveSlacks().stream()
|
95 |
| - .filter(slack -> CollectionUtils.isEmpty(voltageLevelIds) || voltageLevelIds.contains(slack.getVoltageLevelId())) |
| 94 | + .filter(slack -> voltageLevelIds == null || voltageLevelIds.contains(slack.getVoltageLevelId())) |
96 | 95 | .map(slack -> new ReactiveSlack(slack.getVoltageLevelId(), slack.getBusId(), slack.getSlack()))
|
97 | 96 | .toList();
|
98 | 97 | List<BusVoltage> busVoltages = resultEntity.getBusVoltages().stream()
|
99 |
| - .filter(bv -> CollectionUtils.isEmpty(voltageLevelIds) || voltageLevelIds.contains(bv.getVoltageLevelId())) |
| 98 | + .filter(bv -> voltageLevelIds == null || voltageLevelIds.contains(bv.getVoltageLevelId())) |
100 | 99 | .map(bv -> new BusVoltage(bv.getVoltageLevelId(), bv.getBusId(), bv.getV(), bv.getAngle()))
|
101 | 100 | .toList();
|
102 | 101 | return new VoltageInitResult(resultEntity.getResultUuid(), resultEntity.getWriteTimeStamp(), sortedIndicators,
|
|
0 commit comments