-
-
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
Some non null annotations #4486
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Gaël L'hopital <gael@lhopital.org>
...les/org.openhab.core/src/main/java/org/openhab/core/internal/service/BundleResolverImpl.java
Show resolved
Hide resolved
bundles/org.openhab.core/src/main/java/org/openhab/core/util/BundleResolver.java
Show resolved
Hide resolved
import org.openhab.core.common.registry.Identifiable; | ||
|
||
/** | ||
* A listener to be informed before entities are added respectively after they are removed. | ||
* | ||
* @author Simon Kaufmann - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public interface RegistryHook<E extends Identifiable<?>> { |
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.
@wborn @kaikreuzer Do you know about the use case for this Hook? This is only used in registries, which just forward the calls. addRegistryHook
- which seems to be the only method for adding hooks - seems never being called. I could not trace it down to a single use in our core repo, no use in webui, and only 2 uses in add-ons test. However, it is a public interface to register for add/remove of elements in the registries.
It was introduced in ESH times and seems no longer be in use, at least not how it was before.
Shall I create a PR to deprecate this functions in the registries and this class?
return getText(null, key, locale); | ||
} | ||
|
||
private String getTranslatedText(String resourceName, String key, Locale locale) { | ||
private @Nullable String getTranslatedText(String resourceName, String key, Locale locale) { |
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.
The parameters may be Nullable
as well. According to the docs, it would cause a NullpointerException in getBundle
, which leads to returning null.
Not sure if this is the way to go, but at least it would be more consistent with the other methods above.
Signed-off-by: gael@lhopital.org <gael@lhopital.org>
No description provided.