-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Ctor null checks omitted when builder is present, but ctor still package-visible. #345
Comments
Crud, yes, in the absence of extensions the constructor is private so omitting the null checks is valid, but if there is an extension then the constructor has to be package-private so that the extension-generated subclass can call it. I think that means we have to put the null checks back, at least for that case. |
…ve null checks if there are extensions, because in that case the constructor is package-private rather than private. Fixes google#345. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=124847338
Thanks! On Wed, Jun 15, 2016 at 8:17 PM Éamonn McManus notifications@github.com
|
…ve null checks if there are extensions, because in that case the constructor is package-private rather than private. Fixes google#345. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=124847338
…ve null checks if there are extensions, because in that case the constructor is package-private rather than private. Fixes google/auto#345. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=124847338
…ve null checks if there are extensions, because in that case the constructor is package-private rather than private. Fixes google/auto#345. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=124847338
Given a model
AutoValue 1.3-rc1 will generate:
As you can see the constructor is still package scoped which the application code could use to insert a
null
value forwhatever
. This constructor is also used by extensions which are not null-checking their values since they rely on the constructor to validate the nullability constraints.The text was updated successfully, but these errors were encountered: