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

primitive booleans instead of Booleans #365

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pemmasanikrishna
Copy link

favor primitive types over boxed Boolean.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ammokhov
Copy link
Contributor

this seems to intentionally set false/true to the parameter that are initially set only in certain cases, otherwise null. @wbingli @PatMyron seeking ur opinions if we should generalize and always return boolean?

private Boolean snapshotRequested;
private Boolean rollback;
private Boolean driftable;
private boolean snapshotRequested;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest don't change the property type as it will cause method change and it will cause compile error.

As suggest in #341 (comment), we can provide extra helper method, such as isSnapshotRequested to simplify it.

Copy link
Author

Choose a reason for hiding this comment

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

@wbingli I have already taken care of that change and changed the references as well. And the pr got build is successful. Do yoy want me to revert the change and provide helper method ?

Copy link
Contributor

Choose a reason for hiding this comment

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

The point is that anyone who uses this class will be broken. The java plugin can build successful doesn't mean it won't break others. Therefore, I suggest to add helper method in the class instead of change the field type.

@PatMyron PatMyron changed the title resolves #341 primitive booleans over Booleans Apr 19, 2021
@PatMyron PatMyron changed the title primitive booleans over Booleans primitive booleans instead of Booleans Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants