-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add by formula modification #359
Conversation
if (filters == null) { | ||
this.filters = formulaInfos.getFilters().stream().map(FilterInfos::toEntity).collect(Collectors.toList()); | ||
} else { | ||
filters.clear(); | ||
filters.addAll(formulaInfos.getFilters().stream().map(FilterInfos::toEntity).collect(Collectors.toList())); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (filters == null) { | |
this.filters = formulaInfos.getFilters().stream().map(FilterInfos::toEntity).collect(Collectors.toList()); | |
} else { | |
filters.clear(); | |
filters.addAll(formulaInfos.getFilters().stream().map(FilterInfos::toEntity).collect(Collectors.toList())); | |
} | |
this.filters = formulaInfos.getFilters().stream().map(FilterInfos::toEntity).collect(Collectors.toList()); |
src/main/java/org/gridsuite/modification/server/modifications/ByFormulaModification.java
Outdated
Show resolved
Hide resolved
List<Report> formulaReports, | ||
FormulaInfos formulaInfos, | ||
FilterInfos filterInfos) { | ||
var filterEquipments = exportFilters.get(filterInfos.getId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To enhance code readability and maintainability, I suggest specifying the explicit return type instead of using var
var filterEquipments = exportFilters.get(filterInfos.getId()); | |
FilterEquipments filterEquipments = exportFilters.get(filterInfos.getId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
.build()); | ||
|
||
if (!CollectionUtils.isEmpty(filterEquipments.getNotFoundEquipments())) { | ||
var equipmentIds = String.join(", ", filterEquipments.getNotFoundEquipments()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var equipmentIds = String.join(", ", filterEquipments.getNotFoundEquipments()); | |
String equipmentIds = String.join(", ", filterEquipments.getNotFoundEquipments()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
public boolean isValidFilter(Reporter subReporter, | ||
NetworkModificationException.Type errorType, | ||
Map<UUID, String> filters, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not used
Map<UUID, String> filters, | ||
Map<UUID, FilterEquipments> exportFilters) { | ||
// collect all filters with wrong equipments ids | ||
Map<UUID, FilterEquipments> filterWithWrongEquipmentsIds = exportFilters.entrySet() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this variable is not used
…suite/network-modification-server into add_by_formula_modification
case DIVISION -> { | ||
if (value2 == 0) { | ||
throw new NetworkModificationException(NetworkModificationException.Type.BY_FORMULA_MODIFICATION_ERROR, | ||
"there is a division by 0 in one formula"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace with "there is a division by zero in a formula"
src/main/java/org/gridsuite/modification/server/service/FilterService.java
Show resolved
Hide resolved
Kudos, SonarCloud Quality Gate passed! |
No description provided.