-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
Request: implement/add ExtensionRegistry.isEmpty() in Java #52
Comments
Can you expand on the reasons to check whether an ExtensionRegistry is empty? |
Use case, one of many: you have a nonnull field, parameter of type Or you've got a registry value, and if it is empty you do nothing, The feature is safe, and doesn't break anything!
|
This feature request is very old. I don't think in general we attempt to give every type an empty/null value that is recognizable. If you want a value to be possibly absent, it seems to make more sense to just make it nullable, instead of making it nonnull but having an "empty" value. |
Make OneofDef stop deriving from Def.
It is crucial to know whether an ExtensionRegistry is empty - for a number of reasons; but impossible at the moment. It could have been produced as ExtensionRegistry.getEmptyRegistry(), or as the result of ExtensionRegistry.newInstance(), or ExtensionRegistry.newInstance().getUnmodifiable(), and so forth.
However, there is no access to the underlying map, or its length, and also there is no equals.
The text was updated successfully, but these errors were encountered: