remove Disconnector default value from create section#202
Conversation
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
📝 WalkthroughWalkthroughIn ChangesNull Switch Kind Fallback
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with 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.
Inline comments:
In
`@src/main/java/org/gridsuite/modification/modifications/CreateVoltageLevelSection.java`:
- Around line 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.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 74d1b1bd-e6b5-46aa-aae6-559a6c5ce62f
📒 Files selected for processing (1)
src/main/java/org/gridsuite/modification/modifications/CreateVoltageLevelSection.java
| .withLeftSwitchKind(modificationInfos.getLeftSwitchKind() != null ? SwitchKind.valueOf(modificationInfos.getLeftSwitchKind()) : null) | ||
| .withRightSwitchKind(modificationInfos.getRightSwitchKind() != null ? SwitchKind.valueOf(modificationInfos.getRightSwitchKind()) : null) |
There was a problem hiding this comment.
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.



PR Summary
linked to powsybl/powsybl-core#3935