Skip to content

Fixed MonetaryAccountReferenceTypeAdapter to output proper value. (bunq/sdk_java#49) #68

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Conversation

OGKevin
Copy link
Contributor

@OGKevin OGKevin commented Jan 7, 2018

This PR closes/fixes the following issues:

@OGKevin OGKevin added this to the 0.12.5 milestone Jan 7, 2018
@OGKevin OGKevin self-assigned this Jan 7, 2018
@OGKevin
Copy link
Contributor Author

OGKevin commented Jan 8, 2018

@patrickdw1991 all yours please 👀

@OGKevin OGKevin requested a review from patrickdw1991 January 8, 2018 08:36
@bunq bunq deleted a comment Jan 8, 2018
out.nullValue();
} else if (value.getPointer() == null) {

Choose a reason for hiding this comment

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

Wouldn't it be nicer to check if the value.getLabelMonetaryAccount is not null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But thats already done above ? if (value == null || value.isAllFieldNull()) { via isAllFieldNull ? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The statements that follow is purely to know which one to use as both cant be populated with data.

Choose a reason for hiding this comment

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

There you check if all fields are null. Here you check if the pointer is null. Wouldn't it be nicer to check:

else if (value.getLabelMonetaryAccount() != null) {

Because in theory it doesn't mean that if not all fields are null and the pointer is null that the Monetary account label is not null.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😮 😁 🤦‍♂️ makes sense.

@OGKevin
Copy link
Contributor Author

OGKevin commented Jan 8, 2018

@andrederoos all yours please 👀

@OGKevin OGKevin requested a review from andrederoos January 8, 2018 09:44
@OGKevin OGKevin assigned andrederoos and unassigned patrickdw1991 Jan 8, 2018
@bunq bunq deleted a comment Jan 8, 2018
@andrederoos andrederoos merged commit 8417df4 into develop Jan 8, 2018
@andrederoos andrederoos deleted the bunq/sdk_java#49-getCounterpartyAlias-returns-null-when-printed branch January 8, 2018 22:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getCounterpartyAlias() returns null on payments
3 participants