Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
df299c7
Fix new issues after checkstyle changes, up to iidm-test
rolnico Dec 8, 2025
7af6fa2
Continue fixing the issues
rolnico Dec 8, 2025
e88184e
Fix new issues after checkstyle changes, up to iidm-impl and fix some…
rolnico Dec 16, 2025
c4a8363
Fix FourSubstationsNodeBreakerFactory
rolnico Dec 16, 2025
b4bcfe7
Fix new issues after checkstyle changes, up to iidm-serde
rolnico Dec 16, 2025
e1a6656
Fix new issues after checkstyle changes, up to loadflow-api
rolnico Dec 17, 2025
a5156e5
Fix new issues after checkstyle changes, up to iidm-modification
rolnico Dec 17, 2025
430349c
Fix new issues after checkstyle changes, up to security-analysis
rolnico Dec 17, 2025
8cbed7d
Fix new issues after checkstyle changes, up to security-analysis-api
rolnico Dec 17, 2025
5a12130
Fix new issues after checkstyle changes, up to triple-store
rolnico Dec 17, 2025
b861364
Fix new issues after checkstyle changes, up to loadflow-results-compl…
rolnico Dec 17, 2025
28e6fc3
Fix new issues after checkstyle changes, up to cgmes-completion
rolnico Dec 18, 2025
bcfd2be
Fix new issues after checkstyle changes, up to cgmes-alternatives
rolnico Dec 18, 2025
f809ef1
Fix new issues after checkstyle changes
rolnico Dec 18, 2025
3a2aeba
revert parent version to 24
rolnico Dec 18, 2025
efa70c0
Modify @SuppressWarnings("checkstyle:IllegalCatch") to IllegalCatchEr…
rolnico Dec 18, 2025
7634932
Merge branch 'main' into nro/new_checkstyle
rolnico Jan 26, 2026
d37ac42
fix reports_fr.properties due to migration to UTF-8 encoding
rolnico Jan 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ public static PhaseTapChangerRegulationAction activateRegulation(String id, Stri
return new PhaseTapChangerRegulationAction(id, transformerId, side, true, null, null);
}

public static PhaseTapChangerRegulationAction activateAndChangeRegulationMode(String id, String transformerId, PhaseTapChanger.RegulationMode regulationMode, Double regulationValue) {
public static PhaseTapChangerRegulationAction activateAndChangeRegulationMode(String id, String transformerId,
PhaseTapChanger.RegulationMode regulationMode, Double regulationValue) {
return new PhaseTapChangerRegulationAction(id, transformerId, null, true, regulationMode, regulationValue);
}

public static PhaseTapChangerRegulationAction activateAndChangeRegulationMode(String id, String transformerId, ThreeSides side, PhaseTapChanger.RegulationMode regulationMode, Double regulationValue) {
public static PhaseTapChangerRegulationAction activateAndChangeRegulationMode(String id, String transformerId, ThreeSides side,
PhaseTapChanger.RegulationMode regulationMode, Double regulationValue) {
return new PhaseTapChangerRegulationAction(id, transformerId, side, true, regulationMode, regulationValue);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import com.powsybl.commons.json.JsonUtil;
import com.powsybl.action.AbstractTapChangerRegulationAction;
import com.powsybl.commons.json.JsonUtil;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import com.powsybl.commons.json.JsonUtil;
import com.powsybl.action.AbstractTapChangerTapPositionAction;
import com.powsybl.commons.json.JsonUtil;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ TerminalsConnectionAction.NAME, new TerminalsConnectionActionSerializer(),
registerActionBuilderType(RatioTapChangerRegulationAction.class, RatioTapChangerRegulationActionBuilder.class, RatioTapChangerRegulationAction.NAME,
new RatioTapChangerRegulationActionSerializer(), new RatioTapChangerRegulationActionBuilderBuilderDeserializer());
registerActionBuilderType(LoadAction.class, LoadActionBuilder.class, LoadAction.NAME, new LoadActionSerializer(), new LoadActionBuilderBuilderDeserializer());
registerActionBuilderType(PercentChangeLoadAction.class, PercentChangeLoadActionBuilder.class, PercentChangeLoadAction.NAME, new PercentChangeLoadActionSerializer(), new PercentChangeLoadActionBuilderDeserializer());
registerActionBuilderType(DanglingLineAction.class, DanglingLineActionBuilder.class, DanglingLineAction.NAME, new DanglingLineActionSerializer(), new DanglingLineActionBuilderBuilderDeserializer());
registerActionBuilderType(PercentChangeLoadAction.class, PercentChangeLoadActionBuilder.class,
PercentChangeLoadAction.NAME, new PercentChangeLoadActionSerializer(), new PercentChangeLoadActionBuilderDeserializer());
registerActionBuilderType(DanglingLineAction.class, DanglingLineActionBuilder.class,
DanglingLineAction.NAME, new DanglingLineActionSerializer(), new DanglingLineActionBuilderBuilderDeserializer());
registerActionBuilderType(HvdcAction.class, HvdcActionBuilder.class, HvdcAction.NAME, new HvdcActionSerializer(), new HvdcActionBuilderDeserializer());
registerActionBuilderType(GeneratorAction.class, GeneratorActionBuilder.class, GeneratorAction.NAME,
new GeneratorActionSerializer(), new GeneratorActionBuilderDeserializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.powsybl.action.Action;
import com.powsybl.action.ActionBuilder;
import com.powsybl.action.ActionList;
import com.powsybl.action.IdentifierActionList;
import com.powsybl.commons.json.JsonUtil;
import com.powsybl.action.Action;
import com.powsybl.action.ActionList;
import com.powsybl.iidm.network.identifiers.NetworkElementIdentifier;

import java.io.IOException;
Expand Down Expand Up @@ -45,31 +45,7 @@ public static class ParsingContext {
@Override
public ActionList deserialize(JsonParser parser, DeserializationContext deserializationContext) throws IOException {
ParsingContext context = new ParsingContext();
JsonUtil.parseObject(parser, fieldName -> {
switch (fieldName) {
case VERSION:
context.version = parser.nextTextValue();
deserializationContext.setAttribute(VERSION, context.version);
return true;
case "actions":
parser.nextToken();
List<ActionBuilder> actionBuilders = JsonUtil.readList(deserializationContext, parser, ActionBuilder.class);
context.actions = actionBuilders.stream().map(ActionBuilder::build).toList();
return true;
case "elementIdentifiers":
parser.nextToken();
context.elementIdentifierMap = parser.readValueAs(new TypeReference<HashMap<String, NetworkElementIdentifier>>() {
});
return true;
case "actionBuilders":
parser.nextToken();
context.actionBuilderMap = parser.readValueAs(new TypeReference<HashMap<String, ActionBuilder>>() {
});
return true;
default:
return false;
}
});
JsonUtil.parseObject(parser, fieldName -> parseActionList(parser, deserializationContext, context, fieldName));
if (context.version == null) {
throw new JsonMappingException(parser, "version is missing");
}
Expand All @@ -88,4 +64,30 @@ public ActionList deserialize(JsonParser parser, DeserializationContext deserial
}
return new ActionList(context.actions);
}

private boolean parseActionList(JsonParser parser, DeserializationContext deserializationContext, ParsingContext context, String fieldName) throws IOException {
switch (fieldName) {
case VERSION:
context.version = parser.nextTextValue();
deserializationContext.setAttribute(VERSION, context.version);
return true;
case "actions":
parser.nextToken();
List<ActionBuilder> actionBuilders = JsonUtil.readList(deserializationContext, parser, ActionBuilder.class);
context.actions = actionBuilders.stream().map(ActionBuilder::build).toList();
return true;
case "elementIdentifiers":
parser.nextToken();
context.elementIdentifierMap = parser.readValueAs(new TypeReference<HashMap<String, NetworkElementIdentifier>>() {
});
return true;
case "actionBuilders":
parser.nextToken();
context.actionBuilderMap = parser.readValueAs(new TypeReference<HashMap<String, ActionBuilder>>() {
});
return true;
default:
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,29 @@ protected AreaInterchangeTargetActionDeserializer() {
@Override
public AreaInterchangeTargetActionBuilder deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
AreaInterchangeTargetActionBuilder builder = new AreaInterchangeTargetActionBuilder();
JsonUtil.parsePolymorphicObject(jsonParser, name -> {
switch (name) {
case "type":
if (!AreaInterchangeTargetAction.NAME.equals(jsonParser.nextTextValue())) {
throw JsonMappingException.from(jsonParser, "Expected type " + AreaInterchangeTargetAction.NAME);
}
return true;
case "id":
builder.withId(jsonParser.nextTextValue());
return true;
case "areaId":
builder.withAreaId(jsonParser.nextTextValue());
return true;
case "interchangeTarget":
jsonParser.nextToken();
builder.withTarget(jsonParser.getValueAsDouble());
return true;
default:
return false;
}
});
JsonUtil.parsePolymorphicObject(jsonParser, name -> parseAreaInterchangeTargetAction(jsonParser, builder, name));
return builder;
}

private boolean parseAreaInterchangeTargetAction(JsonParser jsonParser, AreaInterchangeTargetActionBuilder builder, String name) throws IOException {
switch (name) {
case "type":
if (!AreaInterchangeTargetAction.NAME.equals(jsonParser.nextTextValue())) {
throw JsonMappingException.from(jsonParser, "Expected type " + AreaInterchangeTargetAction.NAME);
}
return true;
case "id":
builder.withId(jsonParser.nextTextValue());
return true;
case "areaId":
builder.withAreaId(jsonParser.nextTextValue());
return true;
case "interchangeTarget":
jsonParser.nextToken();
builder.withTarget(jsonParser.getValueAsDouble());
return true;
default:
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.powsybl.commons.json.JsonUtil;
import com.powsybl.action.GeneratorAction;
import com.powsybl.action.GeneratorActionBuilder;
import com.powsybl.commons.json.JsonUtil;

import java.io.IOException;

Expand All @@ -29,43 +29,45 @@ public GeneratorActionBuilderDeserializer() {
@Override
public GeneratorActionBuilder deserialize(JsonParser parser, DeserializationContext deserializationContext) throws IOException {
GeneratorActionBuilder generatorActionBuilder = new GeneratorActionBuilder();
JsonUtil.parsePolymorphicObject(parser, name -> {
switch (name) {
case "type":
if (!GeneratorAction.NAME.equals(parser.nextTextValue())) {
throw JsonMappingException.from(parser, "Expected type " + GeneratorAction.NAME);
}
return true;
case "id":
generatorActionBuilder.withId(parser.nextTextValue());
return true;
case "generatorId":
generatorActionBuilder.withGeneratorId(parser.nextTextValue());
return true;
case "activePowerRelativeValue":
parser.nextToken();
generatorActionBuilder.withActivePowerRelativeValue(parser.getValueAsBoolean());
return true;
case "activePowerValue":
parser.nextToken();
generatorActionBuilder.withActivePowerValue(parser.getValueAsDouble());
return true;
case "voltageRegulatorOn":
parser.nextToken();
generatorActionBuilder.withVoltageRegulatorOn(parser.getValueAsBoolean());
return true;
case "targetV":
parser.nextToken();
generatorActionBuilder.withTargetV(parser.getValueAsDouble());
return true;
case "targetQ":
parser.nextToken();
generatorActionBuilder.withTargetQ(parser.getValueAsDouble());
return true;
default:
return false;
}
});
JsonUtil.parsePolymorphicObject(parser, name -> parseGeneratorAction(parser, generatorActionBuilder, name));
return generatorActionBuilder;
}

private boolean parseGeneratorAction(JsonParser parser, GeneratorActionBuilder generatorActionBuilder, String name) throws IOException {
switch (name) {
case "type":
if (!GeneratorAction.NAME.equals(parser.nextTextValue())) {
throw JsonMappingException.from(parser, "Expected type " + GeneratorAction.NAME);
}
return true;
case "id":
generatorActionBuilder.withId(parser.nextTextValue());
return true;
case "generatorId":
generatorActionBuilder.withGeneratorId(parser.nextTextValue());
return true;
case "activePowerRelativeValue":
parser.nextToken();
generatorActionBuilder.withActivePowerRelativeValue(parser.getValueAsBoolean());
return true;
case "activePowerValue":
parser.nextToken();
generatorActionBuilder.withActivePowerValue(parser.getValueAsDouble());
return true;
case "voltageRegulatorOn":
parser.nextToken();
generatorActionBuilder.withVoltageRegulatorOn(parser.getValueAsBoolean());
return true;
case "targetV":
parser.nextToken();
generatorActionBuilder.withTargetV(parser.getValueAsDouble());
return true;
case "targetQ":
parser.nextToken();
generatorActionBuilder.withTargetQ(parser.getValueAsDouble());
return true;
default:
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.powsybl.commons.json.JsonUtil;
import com.powsybl.iidm.network.HvdcLine;
import com.powsybl.action.HvdcAction;
import com.powsybl.action.HvdcActionBuilder;
import com.powsybl.commons.json.JsonUtil;
import com.powsybl.iidm.network.HvdcLine;

import java.io.IOException;

Expand All @@ -30,46 +30,48 @@ public HvdcActionBuilderDeserializer() {
@Override
public HvdcActionBuilder deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
HvdcActionBuilder hvdcActionBuilder = new HvdcActionBuilder();
JsonUtil.parsePolymorphicObject(jsonParser, name -> {
switch (name) {
case "type":
if (!HvdcAction.NAME.equals(jsonParser.nextTextValue())) {
throw JsonMappingException.from(jsonParser, "Expected type " + HvdcAction.NAME);
}
return true;
case "id":
hvdcActionBuilder.withId(jsonParser.nextTextValue());
return true;
case "hvdcId":
hvdcActionBuilder.withHvdcId(jsonParser.nextTextValue());
return true;
case "acEmulationEnabled":
jsonParser.nextToken();
hvdcActionBuilder.withAcEmulationEnabled(jsonParser.getValueAsBoolean());
return true;
case "activePowerSetpoint":
jsonParser.nextToken();
hvdcActionBuilder.withActivePowerSetpoint(jsonParser.getValueAsDouble());
return true;
case "converterMode":
hvdcActionBuilder.withConverterMode(HvdcLine.ConvertersMode.valueOf(jsonParser.nextTextValue()));
return true;
case "droop":
jsonParser.nextToken();
hvdcActionBuilder.withDroop(jsonParser.getValueAsDouble());
return true;
case "p0":
jsonParser.nextToken();
hvdcActionBuilder.withP0(jsonParser.getValueAsDouble());
return true;
case "relativeValue":
jsonParser.nextToken();
hvdcActionBuilder.withRelativeValue(jsonParser.getValueAsBoolean());
return true;
default:
return false;
}
});
JsonUtil.parsePolymorphicObject(jsonParser, name -> parseHvdcAction(jsonParser, hvdcActionBuilder, name));
return hvdcActionBuilder;
}

private boolean parseHvdcAction(JsonParser jsonParser, HvdcActionBuilder hvdcActionBuilder, String name) throws IOException {
switch (name) {
case "type":
if (!HvdcAction.NAME.equals(jsonParser.nextTextValue())) {
throw JsonMappingException.from(jsonParser, "Expected type " + HvdcAction.NAME);
}
return true;
case "id":
hvdcActionBuilder.withId(jsonParser.nextTextValue());
return true;
case "hvdcId":
hvdcActionBuilder.withHvdcId(jsonParser.nextTextValue());
return true;
case "acEmulationEnabled":
jsonParser.nextToken();
hvdcActionBuilder.withAcEmulationEnabled(jsonParser.getValueAsBoolean());
return true;
case "activePowerSetpoint":
jsonParser.nextToken();
hvdcActionBuilder.withActivePowerSetpoint(jsonParser.getValueAsDouble());
return true;
case "converterMode":
hvdcActionBuilder.withConverterMode(HvdcLine.ConvertersMode.valueOf(jsonParser.nextTextValue()));
return true;
case "droop":
jsonParser.nextToken();
hvdcActionBuilder.withDroop(jsonParser.getValueAsDouble());
return true;
case "p0":
jsonParser.nextToken();
hvdcActionBuilder.withP0(jsonParser.getValueAsDouble());
return true;
case "relativeValue":
jsonParser.nextToken();
hvdcActionBuilder.withRelativeValue(jsonParser.getValueAsBoolean());
return true;
default:
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import com.powsybl.commons.json.JsonUtil;
import com.powsybl.action.HvdcAction;
import com.powsybl.commons.json.JsonUtil;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.powsybl.action.ActionBuilder;
import com.powsybl.action.MultipleActionsAction;
import com.powsybl.action.MultipleActionsActionBuilder;
import com.powsybl.commons.json.JsonUtil;
import com.powsybl.action.MultipleActionsAction;

import java.io.IOException;

Expand Down
Loading
Loading