Skip to content

Commit ac6b4e1

Browse files
authored
Use correct builder for limit sets tabular modifications (#669)
Signed-off-by: Hugo Marcellin <[email protected]>
1 parent 1998d76 commit ac6b4e1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/org/gridsuite/modification/server/repositories/NetworkModificationRepository.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,11 @@ private TabularModificationInfos loadTabularModification(ModificationEntity modi
367367
// re-order the list of entities based on the ordered list of IDs
368368
List<EquipmentModificationEntity> orderedModifications = reorderModifications(modifications, subModificationsUuids);
369369
// then build DTOs
370-
return TabularModificationInfos.builder()
371-
.uuid(tabularModificationEntity.getId())
370+
var builder = TabularModificationInfos.builder();
371+
if (tabularModificationEntity.getType().equals(ModificationType.LIMIT_SETS_TABULAR_MODIFICATION.name())) {
372+
builder = LimitSetsTabularModificationInfos.builder();
373+
}
374+
return builder.uuid(tabularModificationEntity.getId())
372375
.date(tabularModificationEntity.getDate())
373376
.stashed(tabularModificationEntity.getStashed())
374377
.activated(tabularModificationEntity.getActivated())

0 commit comments

Comments
 (0)