Skip to content

Commit

Permalink
code review remarqs
Browse files Browse the repository at this point in the history
  • Loading branch information
ghazwarhili committed Sep 17, 2024
1 parent bf54e68 commit 3e5efe3
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 138 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public final class ModificationUtils {
public static final String CONNECTION_NAME_FIELD_NAME = "Connection name";
public static final String CONNECTION_DIRECTION_FIELD_NAME = "Connection direction";
public static final String CONNECTION_POSITION_FIELD_NAME = "Connection position";
public static final String NETWORK_NOT_EXIST = " does not exist in network";
public static final String NOT_EXIST_IN_NETWORK = " does not exist in network";

private ModificationUtils() {
}
Expand Down Expand Up @@ -90,23 +90,23 @@ Line getLine(Network network, String lineId) {
Battery getBattery(Network network, String batteryId) {
Battery battery = network.getBattery(batteryId);
if (battery == null) {
throw new NetworkModificationException(BATTERY_NOT_FOUND, "Battery " + batteryId + NETWORK_NOT_EXIST);
throw new NetworkModificationException(BATTERY_NOT_FOUND, "Battery " + batteryId + NOT_EXIST_IN_NETWORK);
}
return battery;
}

Generator getGenerator(Network network, String generatorId) {
Generator generator = network.getGenerator(generatorId);
if (generator == null) {
throw new NetworkModificationException(GENERATOR_NOT_FOUND, "Generator " + generatorId + NETWORK_NOT_EXIST);
throw new NetworkModificationException(GENERATOR_NOT_FOUND, "Generator " + generatorId + NOT_EXIST_IN_NETWORK);
}
return generator;
}

VscConverterStation getVscConverterStation(Network network, String converterStationId) {
VscConverterStation vscConverterStation = network.getVscConverterStation(converterStationId);
if (vscConverterStation == null) {
throw new NetworkModificationException(VSC_CONVERTER_STATION_NOT_FOUND, "Vsc converter station " + converterStationId + NETWORK_NOT_EXIST);
throw new NetworkModificationException(VSC_CONVERTER_STATION_NOT_FOUND, "Vsc converter station " + converterStationId + NOT_EXIST_IN_NETWORK);
}
return vscConverterStation;
}
Expand All @@ -115,7 +115,7 @@ VscConverterStation getVscConverterStation(Network network, String converterStat
HvdcLine getHvdcLine(Network network, String hvdcLineId) {
HvdcLine hvdcLine = network.getHvdcLine(hvdcLineId);
if (hvdcLine == null) {
throw new NetworkModificationException(HVDC_LINE_NOT_FOUND, "Hvdc line " + hvdcLineId + NETWORK_NOT_EXIST);
throw new NetworkModificationException(HVDC_LINE_NOT_FOUND, "Hvdc line " + hvdcLineId + NOT_EXIST_IN_NETWORK);
}
return hvdcLine;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,198 +4,122 @@
<addColumn tableName="line_modification">
<column name="bus_or_busbar_section_id1" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="bus_or_busbar_section_id1op" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="bus_or_busbar_section_id2" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="bus_or_busbar_section_id2op" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="connection_direction1" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="connection_direction1op" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="connection_direction2" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="connection_direction2op" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="connection_name1" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="connection_name1op" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="connection_name2" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="connection_name2op" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="connection_position1" type="integer"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="connection_position1op" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="connection_position2" type="integer"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="connection_position2op" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="voltage_level_id1" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="voltage_level_id1op" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="voltage_level_id2" type="varchar(255)"/>
</addColumn>
<addColumn tableName="line_modification">
<column name="voltage_level_id2op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-30">
<addColumn tableName="two_windings_transformer_modification">
<column name="bus_or_busbar_section_id1" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-31">
<addColumn tableName="line_modification">
<column name="bus_or_busbar_section_id1op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-32">
<addColumn tableName="two_windings_transformer_modification">
<column name="bus_or_busbar_section_id1op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-33">
<addColumn tableName="line_modification">
<column name="bus_or_busbar_section_id2" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-34">
<addColumn tableName="two_windings_transformer_modification">
<column name="bus_or_busbar_section_id2" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-35">
<addColumn tableName="line_modification">
<column name="bus_or_busbar_section_id2op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-36">
<addColumn tableName="two_windings_transformer_modification">
<column name="bus_or_busbar_section_id2op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-37">
<addColumn tableName="line_modification">
<column name="connection_direction1" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-38">
<addColumn tableName="two_windings_transformer_modification">
<column name="connection_direction1" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-39">
<addColumn tableName="line_modification">
<column name="connection_direction1op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-40">
<addColumn tableName="two_windings_transformer_modification">
<column name="connection_direction1op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-41">
<addColumn tableName="line_modification">
<column name="connection_direction2" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-42">
<addColumn tableName="two_windings_transformer_modification">
<column name="connection_direction2" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-43">
<addColumn tableName="line_modification">
<column name="connection_direction2op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-44">
<addColumn tableName="two_windings_transformer_modification">
<column name="connection_direction2op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-45">
<addColumn tableName="line_modification">
<column name="connection_name1" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-46">
<addColumn tableName="two_windings_transformer_modification">
<column name="connection_name1" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-47">
<addColumn tableName="line_modification">
<column name="connection_name1op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-48">
<addColumn tableName="two_windings_transformer_modification">
<column name="connection_name1op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-49">
<addColumn tableName="line_modification">
<column name="connection_name2" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-50">
<addColumn tableName="two_windings_transformer_modification">
<column name="connection_name2" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-51">
<addColumn tableName="line_modification">
<column name="connection_name2op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-52">
<addColumn tableName="two_windings_transformer_modification">
<column name="connection_name2op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-53">
<addColumn tableName="line_modification">
<column name="connection_position1" type="integer"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-54">
<addColumn tableName="two_windings_transformer_modification">
<column name="connection_position1" type="integer"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-55">
<addColumn tableName="line_modification">
<column name="connection_position1op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-56">
<addColumn tableName="two_windings_transformer_modification">
<column name="connection_position1op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-57">
<addColumn tableName="line_modification">
<column name="connection_position2" type="integer"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-58">
<addColumn tableName="two_windings_transformer_modification">
<column name="connection_position2" type="integer"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-59">
<addColumn tableName="line_modification">
<column name="connection_position2op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-60">
<addColumn tableName="two_windings_transformer_modification">
<column name="connection_position2op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-61">
<addColumn tableName="line_modification">
<column name="voltage_level_id1" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-62">
<addColumn tableName="two_windings_transformer_modification">
<column name="voltage_level_id1" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-63">
<addColumn tableName="line_modification">
<column name="voltage_level_id1op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-64">
<addColumn tableName="two_windings_transformer_modification">
<column name="voltage_level_id1op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-65">
<addColumn tableName="line_modification">
<column name="voltage_level_id2" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-66">
<addColumn tableName="two_windings_transformer_modification">
<column name="voltage_level_id2" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-67">
<addColumn tableName="line_modification">
<column name="voltage_level_id2op" type="varchar(255)"/>
</addColumn>
</changeSet>
<changeSet author="rehiligha (generated)" id="1725484515185-68">
<addColumn tableName="two_windings_transformer_modification">
<column name="voltage_level_id2op" type="varchar(255)"/>
</addColumn>
Expand Down

0 comments on commit 3e5efe3

Please sign in to comment.