-
Notifications
You must be signed in to change notification settings - Fork 211
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
Sonar Cloud miscellaneous fixes 2 #10062
base: master
Are you sure you want to change the base?
Sonar Cloud miscellaneous fixes 2 #10062
Conversation
👋 Hello! Thanks for contributing to our project. You can see the progress at the end of this page and at https://github.com/uyuni-project/uyuni/pull/10062/checks If you are unsure the failing tests are related to your code, you can check the "reference jobs". These are jobs that run on a scheduled time with code from master. If they fail for the same reason as your build, it means the tests or the infrastructure are broken. If they do not fail, but yours do, it means it is related to your code. Reference tests: KNOWN ISSUES Sometimes the build can fail when pulling new jar files from download.opensuse.org . This is a known limitation. Given this happens rarely, when it does, all you need to do is rerun the test. Sorry for the inconvenience. For more tips on troubleshooting, see the troubleshooting guide. Happy hacking! |
33966a4
to
a703ab3
Compare
…ply call the same method in the super class
…uals() calls with a single equalsIgnoreCase() call
… as it cannot be thrown from method body
a703ab3
to
fb90883
Compare
@@ -70,7 +70,7 @@ public String getMinionId() { | |||
* @param minionIdIn the new id | |||
*/ | |||
public void setMinionId(String minionIdIn) { | |||
this.minionId = minionId; | |||
this.minionId = minionIdIn; |
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.
Ouch, this was pretty bad. I would guess this setter was never used, otherwise it would have been a problem.
I would evaluate if it's possible to remove all the setters and turn this pojo into an immutable object.
this.id = idIn; | ||
this.identifier = identifierIn; | ||
this.version = versionIn; | ||
this.releaseType = releaseTypeIn; | ||
this.arch = archIn; |
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.
Looks like this constructor was never used either luckily, maybe we can just remove it.
What does this PR change?
Fixes the following SonarCloud issues, where the fixes are straightforward
After review and approval, they will be squashed into one commit only
SonarCloud fix: java:S1858 toString() should never be called on a String object
SonarCloud fix: java:S1158 Use static primitive wrapper class toString() method
SonarCloud fix: java:S1185 Overriding methods should do more than simply call the same method in the super class
SonarCloud fix: java:S1656 Remove or correct useless self-assignment
SonarCloud fix: java:S1157 Replace toUpperCase()/toLowerCase() and equals() calls with a single equalsIgnoreCase() call
SonarCloud fix: java:S1130 Remove the declaration of thrown exception as it cannot be thrown from method body
SonarCloud fix: java:S2209 Static members should be accessed statically
SonarCloud fix: java:S2097 equals(Object obj) should test the argument type
GUI diff
No difference.
Documentation
Test coverage
Links
Issue(s):
Port(s):
Changelogs
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run: