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

Code cleanup to correct issues reported by Sonar (Consistency) #2967

Merged
merged 86 commits into from
Apr 24, 2024

Conversation

rolnico
Copy link
Member

@rolnico rolnico commented Apr 5, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?
No

What kind of change does this PR introduce?
Bug fixes mainly for issues identified as Consistency + Security Hotspot + Reliability

What is the current behavior?
Many issues are raised by Sonar.

What is the new behavior (if this is a feature change)?
Many issues are now gone.
Some methods deprecated since versions strictly older than 5.0 have been deleted (only those I stumbled upon during this PR)

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

To avoid unsafe Jackson deserialization (see https://rules.sonarsource.com/java/RSPEC-4544/ ), classes implementing the interface BusRef now have to add the Jackson annotation @JsonTypeName(".<ClassName>") (with <ClassName> replaced by the class name. Note the presence of the . before the class name.).
For instance IdBasedBusRef is annotated with @JsonTypeName(".IdBasedBusRef").

Following deprecated methods have been deleted:

  • PlatformConfig.setDefaultConfig
  • PlatformConfig.moduleExists
  • PlatformConfig.getModuleConfig
  • PlatformConfigNamedProvider.findBackwardsCompatible
  • PlatformConfigNamedProvider.findDefaultBackwardsCompatible
  • StandbyAutomaton.getHighVoltageSetPoint
  • StandbyAutomaton.setHighVoltageSetPoint
  • StandbyAutomaton.getLowVoltageSetPoint
  • StandbyAutomaton.setLowVoltageSetPoint
  • StandbyAutomatonAdder.withHighVoltageSetPoint
  • StandbyAutomatonAdder.withLowVoltageSetPoint
  • UndirectedGraph.getMaxVertex (If you override this method, rename it as getVertexCapacity().)

Because of the PlatformConfigNamedProvider. ...BackwardsCompatible methods' deprecation, "default" keyword will not be supported anymore in configuration files. Thus check that you use "default-impl-name" instead of "default" in your configuration, especially in load-flow and dynamic-simulation sections.

The list returned by CandidateComputations.getComputationsNames() is now immutable.

Other information:

@rolnico rolnico added the Breaking Change API is broken label Apr 5, 2024
rolnico added 25 commits April 5, 2024 17:12
Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
…org.apache.commons.io.IOUtils

Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
@rolnico rolnico changed the title Code cleanup to correct issues reported by Sonar Code cleanup to correct issues reported by Sonar (Consistency) Apr 10, 2024
@rolnico rolnico self-assigned this Apr 11, 2024
@rolnico rolnico marked this pull request as ready for review April 11, 2024 14:53
@rolnico
Copy link
Member Author

rolnico commented Apr 12, 2024

This is the first PR, others are coming

rolnico added 5 commits April 24, 2024 09:52
Signed-off-by: Nicolas Rol <[email protected]>
# Conflicts:
#	cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/TransformerConversionTest.java
Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
Signed-off-by: Nicolas Rol <[email protected]>
Copy link

@olperr1 olperr1 merged commit 5bef72f into main Apr 24, 2024
6 checks passed
@olperr1 olperr1 deleted the nro/cleanup branch April 24, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change API is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants