From 13d25940bbe3d812b99b5038d14218e49807d69d Mon Sep 17 00:00:00 2001 From: Rehili Ghazwa Date: Mon, 16 Sep 2024 14:56:24 +0200 Subject: [PATCH 1/2] fix connectable position adder attributes --- .../server/modifications/ModificationUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gridsuite/modification/server/modifications/ModificationUtils.java b/src/main/java/org/gridsuite/modification/server/modifications/ModificationUtils.java index b48b82412..48063a772 100644 --- a/src/main/java/org/gridsuite/modification/server/modifications/ModificationUtils.java +++ b/src/main/java/org/gridsuite/modification/server/modifications/ModificationUtils.java @@ -664,6 +664,7 @@ private void createNewConnectivityPosition(ConnectablePositionAdder adder, CONNECTION_NAME_FIELD_NAME); if (connectionNameReport != null) { reports.add(connectionNameReport); + adder.add(); } ReportNode connectionDirectionReport = applyElementaryModificationsAndReturnReport( @@ -673,6 +674,7 @@ private void createNewConnectivityPosition(ConnectablePositionAdder adder, CONNECTION_DIRECTION_FIELD_NAME); if (connectionDirectionReport != null) { reports.add(connectionDirectionReport); + adder.add(); } ReportNode connectionPositionReport = applyElementaryModificationsAndReturnReport( @@ -682,10 +684,8 @@ private void createNewConnectivityPosition(ConnectablePositionAdder adder, CONNECTION_POSITION_FIELD_NAME); if (connectionPositionReport != null) { reports.add(connectionPositionReport); + adder.add(); } - - // Finalize by adding the feeder - adder.add(); } public void modifyInjectionConnection(InjectionModificationInfos modificationInfos, Injection injection, List subReportNode) { From 1c550f3082f50bf285d43dded9aff7ad07337cb7 Mon Sep 17 00:00:00 2001 From: Rehili Ghazwa Date: Mon, 16 Sep 2024 15:51:57 +0200 Subject: [PATCH 2/2] code review remarks --- .../modification/server/modifications/ModificationUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gridsuite/modification/server/modifications/ModificationUtils.java b/src/main/java/org/gridsuite/modification/server/modifications/ModificationUtils.java index 48063a772..02a6b04b5 100644 --- a/src/main/java/org/gridsuite/modification/server/modifications/ModificationUtils.java +++ b/src/main/java/org/gridsuite/modification/server/modifications/ModificationUtils.java @@ -664,7 +664,6 @@ private void createNewConnectivityPosition(ConnectablePositionAdder adder, CONNECTION_NAME_FIELD_NAME); if (connectionNameReport != null) { reports.add(connectionNameReport); - adder.add(); } ReportNode connectionDirectionReport = applyElementaryModificationsAndReturnReport( @@ -674,7 +673,6 @@ private void createNewConnectivityPosition(ConnectablePositionAdder adder, CONNECTION_DIRECTION_FIELD_NAME); if (connectionDirectionReport != null) { reports.add(connectionDirectionReport); - adder.add(); } ReportNode connectionPositionReport = applyElementaryModificationsAndReturnReport( @@ -684,6 +682,9 @@ private void createNewConnectivityPosition(ConnectablePositionAdder adder, CONNECTION_POSITION_FIELD_NAME); if (connectionPositionReport != null) { reports.add(connectionPositionReport); + } + + if (connectionNameReport != null || connectionDirectionReport != null || connectionPositionReport != null) { adder.add(); } }