Skip to content
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

remove generic computation classes #117

Merged
merged 13 commits into from
Jul 2, 2024

Conversation

Mathieu-Deharbe
Copy link
Contributor

@Mathieu-Deharbe Mathieu-Deharbe commented Jun 3, 2024

Now those classes will be in ws-commons

Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
thangqp and others added 2 commits June 12, 2024 14:29
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
@Mathieu-Deharbe Mathieu-Deharbe requested a review from thangqp June 14, 2024 13:59
Mathieu-Deharbe and others added 3 commits June 14, 2024 17:20
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
return Map.of(
HEADER_LIMIT_REDUCTION,
runContext.getLimitReduction() != null ?
runContext.getLimitReduction().toString() :
getRunContext().getLimitReduction() != null ?
Copy link
Contributor

@thangqp thangqp Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing 'null' argument to parameter annotated as @NotNull

if (getRunContext().getLimitReduction() != null) {
      return Map.of(HEADER_LIMIT_REDUCTION, getRunContext().getLimitReduction());
} else {
      return super.getSpecificMsgHeaders();
}

Not really related but in line 48 and 51, using test by headers.containsKey() is not enough, the value can be null, pls correct line 48 and 51 as following way:

String limitReductionStr = headers.get(HEADER_LIMIT_REDUCTION);
Float limitReduction = limitReductionStr != null ? Float.parseFloat(limitReductionStr) : null

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Damn null parameters in map.of won't get me again.

@@ -66,11 +66,11 @@ public static LoadFlowResultContext fromMessage(Message<String> message, ObjectM
}

@Override
protected Map<String, String> getSpecificMsgHeaders() {
protected Map<String, Object> getSpecificMsgHeaders() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why using Map<String, Object> instead of Map<String, String> (from AbstractResultContext)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover of the voltage init parsing mixup. Reverted. And ObjectMapper added.

Mathieu-Deharbe and others added 6 commits June 25, 2024 12:37
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
@thangqp thangqp self-requested a review June 28, 2024 15:27
Copy link

sonarqubecloud bot commented Jul 2, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
69.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@etiennehomer etiennehomer merged commit 43932b1 into main Jul 2, 2024
2 of 3 checks passed
@etiennehomer etiennehomer deleted the remove-generic-computation-classes branch July 2, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants