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 @@ -84,8 +84,8 @@ public void apply(Network network, NamingStrategy namingStrategy, ReportNode sub
.withAllBusbars(modificationInfos.isAllBusbars())
.withLeftSwitchOpen(modificationInfos.isSwitchOpen())
.withRightSwitchOpen(modificationInfos.isSwitchOpen())
.withLeftSwitchKind(modificationInfos.getLeftSwitchKind() != null ? SwitchKind.valueOf(modificationInfos.getLeftSwitchKind()) : SwitchKind.DISCONNECTOR)
.withRightSwitchKind(modificationInfos.getRightSwitchKind() != null ? SwitchKind.valueOf(modificationInfos.getRightSwitchKind()) : SwitchKind.DISCONNECTOR)
.withLeftSwitchKind(modificationInfos.getLeftSwitchKind() != null ? SwitchKind.valueOf(modificationInfos.getLeftSwitchKind()) : null)
.withRightSwitchKind(modificationInfos.getRightSwitchKind() != null ? SwitchKind.valueOf(modificationInfos.getRightSwitchKind()) : null)
Comment on lines +87 to +88

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 | 🟡 Minor | ⚡ Quick win

Add a regression test for the new null switch-kind path.

This change intentionally alters defaulting semantics, but current referenced tests only cover explicit "BREAKER"/"DISCONNECTOR" inputs. Please add a test where leftSwitchKind and rightSwitchKind are omitted to lock the new contract (null propagated, no implicit DISCONNECTOR default).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/org/gridsuite/modification/modifications/CreateVoltageLevelSection.java`
around lines 87 - 88, The code now allows null values for leftSwitchKind and
rightSwitchKind to be passed through to withLeftSwitchKind and
withRightSwitchKind methods without defaulting to DISCONNECTOR. Add a new
regression test case that omits these switch-kind fields entirely (leaving them
null) to verify that null values are properly propagated through the
CreateVoltageLevelSection modification and that no implicit DISCONNECTOR
defaulting occurs. This test should validate the new null-handling contract
alongside the existing tests that cover explicit BREAKER and DISCONNECTOR
values.

.withSwitchPrefixId(voltageLevel.getId())
.withBusbarSectionPrefixId(voltageLevel.getId())
.build();
Expand Down
Loading