-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Another warning hunting session #4484
Conversation
…ccess Signed-off-by: Gaël L'hopital <[email protected]>
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.
Thanks!
I left a few comments.
For the computation of hash codes, Objects.hashCode
could be helpful, as it handles the null
values properly.
...org.openhab.core/src/main/java/org/openhab/core/internal/library/unit/CurrencyConverter.java
Outdated
Show resolved
Hide resolved
...les/org.openhab.core/src/main/java/org/openhab/core/internal/scheduler/PeriodicAdjuster.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.core/src/main/java/org/openhab/core/types/StateOption.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.core/src/main/java/org/openhab/core/types/StateDescription.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.core/src/main/java/org/openhab/core/types/CommandOption.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.core/src/main/java/org/openhab/core/scheduler/CronAdjuster.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.core/src/main/java/org/openhab/core/internal/service/WatchServiceImpl.java
Outdated
Show resolved
Hide resolved
...openhab.core/src/main/java/org/openhab/core/internal/types/StateDescriptionFragmentImpl.java
Outdated
Show resolved
Hide resolved
...openhab.core/src/main/java/org/openhab/core/internal/types/StateDescriptionFragmentImpl.java
Outdated
Show resolved
Hide resolved
Signed-off-by: [email protected] <[email protected]>
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.
I would actually prefer Objects.hashCode()
over Objects.hash()
....
Using hash()
will change the value, compared to what we had before:
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Objects.html#hash(java.lang.Object...)
(not sure if this is relevant for this class, but we might run into trouble with persisted data)
Signed-off-by: [email protected] <[email protected]>
Done @holgerfriedrich |
bundles/org.openhab.core/src/main/java/org/openhab/core/internal/service/WatchServiceImpl.java
Outdated
Show resolved
Hide resolved
Signed-off-by: [email protected] <[email protected]>
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.
LGTM, thanks for the efforts!
Focused on "Potential null pointer access". Minus 64 warnings