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

Warning hunt in org.openhab.core.addon.xxx #4489

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

clinique
Copy link
Contributor

@clinique clinique commented Dec 9, 2024

Minus 19 warnings

Signed-off-by: Gaël L'hopital <[email protected]>
@clinique clinique requested a review from a team as a code owner December 9, 2024 14:04
@holgerfriedrich
Copy link
Member

LGTM, thanks. Reducing warnings is always appreciated. 👍

Though, I think due to the code freeze, this PR might be delayed until 4.3 is released.

Copy link
Member

@holgerfriedrich holgerfriedrich left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 143 to 144
Long localQualifier = qualifier;
if (localQualifier == null) { // we are the release
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitty gritty: The naming seems inconsistent compared to otherQualifier below. For otherQualifier the semantic is different because other refers to quality in other rather than in this, whereas local refers to the variable being in local scope (I presume). localQualifier and localOtherQualifier seems maybe a bit too much, so perhaps simply thisQualifier and otherQualifier?

Suggested change
Long localQualifier = qualifier;
if (localQualifier == null) { // we are the release
Long thisQualifier = qualifier;
if (thisQualifier == null) { // we are the release

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM.

return -1;
}

// both versions are milestones, we can compare them
return Long.compare(qualifier, other.qualifier);
return Long.compare(localQualifier, otherQualifier);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return Long.compare(localQualifier, otherQualifier);
return Long.compare(thisQualifier, otherQualifier);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Accordingly also

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM.

Signed-off-by: Gaël L'hopital <[email protected]>
@holgerfriedrich holgerfriedrich merged commit 576a63c into openhab:main Dec 16, 2024
3 checks passed
@holgerfriedrich holgerfriedrich added this to the 5.0 milestone Dec 16, 2024
@clinique clinique deleted the warning_hunt_core_addon branch December 19, 2024 10:37
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