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

type-inference-wip branch: objects are compared to 0 instead of null #401

Closed
bagipro opened this issue Dec 4, 2018 · 3 comments
Closed

Comments

@bagipro
Copy link
Collaborator

bagipro commented Dec 4, 2018

Hi, method com.paypal.android.foundation.account.model.Contact.equals(Object)

    public boolean equals(java.lang.Object obj) {
        boolean z = true;
        if (this == obj) {
            return true;
        }
        if (obj != 0) { // <<<
            if (getClass() == obj.getClass()) {
                com.paypal.android.foundation.account.model.Contact contact = (com.paypal.android.foundation.account.model.Contact) obj;
                if (this.uniqueId != null) {
                    z = this.uniqueId.equals(contact.uniqueId);
                } else if (contact.uniqueId != null) {
                    z = false;
                }
                return z;
            }
        }
        return false;
    }

APK: https://drive.google.com/file/d/1pdmRyrp6rDEoYsTJn5RLhv39xXRq5Ksh/view?usp=sharing

@skylot
Copy link
Owner

skylot commented Feb 12, 2019

@sergey-wowwow fixed in the latest commits

@skylot skylot closed this as completed Feb 12, 2019
@bagipro
Copy link
Collaborator Author

bagipro commented Feb 20, 2019

Hi, I've noticed the same thing in new codes, file com/paypal/android/foundation/p2p/operations/PayPalMeOperationsFactory.java

    public static com.paypal.android.foundation.core.operations.Operation<com.paypal.android.foundation.p2p.model.PayPalMeSuggestionsResult> newPayPalMeSuggestionsOperation(com.paypal.android.foundation.core.operations.ChallengePresenter challengePresenter, @android.support.annotation.Nullable java.lang.Object obj, int i) { // java.lang.Object obj is java.lang.String str in master branch
        com.paypal.android.foundation.core.CommonContracts.requireAny(challengePresenter);
        org.json.JSONObject jSONObject = new org.json.JSONObject();
        try {
            java.lang.String str = "preferred_id";
            if (obj == 0) { // compared with 0
                obj = org.json.JSONObject.NULL;
            }
            jSONObject.put(str, obj);

APK: https://drive.google.com/file/d/16O--dtXt35zB1Ahx-9qEYvCmyeF1n0AG/view?usp=sharing

@skylot
Copy link
Owner

skylot commented Feb 26, 2019

@sergey-wowwow fixed in latest commit, please check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants