Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.gridsuite.modification.modifications.AbstractModification;
import org.gridsuite.modification.modifications.LineModification;

import java.util.List;

/**
* @author Ayoub LABIDI <ayoub.labidi at rte-france.com>
*/
Expand All @@ -45,6 +47,9 @@ public class LineModificationInfos extends BranchModificationInfos {
@Schema(description = "Shunt susceptance Side 2")
private AttributeModification<Double> b2;

@Schema(description = "segments used from catalog to generate limits")
private List<LineSegmentInfos> lineSegments;
Comment on lines +50 to +51
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

lineSegments is not applied in line modification execution.

The added DTO field is not used by src/main/java/org/gridsuite/modification/modifications/LineModification.java (Line 28-77 snippet): apply() and modifyLine() never read lineSegments. This makes the new API field ineffective at runtime.

Please connect this field to the modification logic (or block unsupported input) to avoid false feature signaling.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/org/gridsuite/modification/dto/LineModificationInfos.java`
around lines 50 - 51, The new DTO field LineModificationInfos.lineSegments is
never consumed by the modification logic; update LineModification.apply() and/or
modifyLine() to read and use lineSegments from the provided
LineModificationInfos when computing segment-based limits (e.g., pass the list
into the existing limit-generation or segment-matching code paths) so the API
field takes effect, or alternatively add explicit validation in
LineModification.apply() that rejects requests containing non-empty lineSegments
with a clear error (throwing an exception or returning a validation failure) to
avoid silently ignored input; locate usages by the class/method names
LineModification, apply(), modifyLine(), and the DTO class LineModificationInfos
and incorporate the field into the limit calculation or validation flow
accordingly.


@Override
public AbstractModification toModification() {
return new LineModification(this);
Expand Down
Loading