Closed Bug 1261995 Opened 8 years ago Closed 8 years ago

[infer] Errors in push

Categories

(Firefox for Android Graveyard :: General, defect)

Unspecified
Android
defect
Not set
normal

Tracking

(firefox48 fixed)

RESOLVED FIXED
Firefox 48
Tracking Status
firefox48 --- fixed

People

(Reporter: mcomella, Assigned: nalexander, Mentored)

References

Details

(Whiteboard: [lang=java][good next bug])

Attachments

(1 file)

/var/lib/jenkins/workspace/fennec-infer/mobile/android/services/src/main/java/org/mozilla/gecko/push/autopush/AutopushClient.java:150: error: NULL_DEREFERENCE
  object returned by body.getLong("code") could be null and is dereferenced at line 150

/var/lib/jenkins/workspace/fennec-infer/mobile/android/services/src/main/java/org/mozilla/gecko/push/autopush/AutopushClient.java:151: error: NULL_DEREFERENCE
  object returned by body.getLong("errno") could be null and is dereferenced at line 151

Nick, mind taking a look?
Flags: needinfo?(nalexander)
https://dxr.mozilla.org/mozilla-central/rev/d9f50aa0a1aaf90499b85c31e0f329b762e80fdd/mobile/android/services/src/main/java/org/mozilla/gecko/push/autopush/AutopushClient.java#147 shows:

            // TODO: The service doesn't do the right thing yet :(
            // body.throwIfFieldsMissingOrMisTyped(requiredErrorStringFields, String.class);
            // body.throwIfFieldsMissingOrMisTyped(requiredErrorLongFields, Long.class);

Patch inbound.
Flags: needinfo?(nalexander)
Comment on attachment 8738315 [details]
MozReview Request: Bug 1261995 - Quiet infer NullPointerException warnings. r?mcomella

https://reviewboard.mozilla.org/r/44445/#review43163

::: mobile/android/services/src/main/java/org/mozilla/gecko/push/autopush/AutopushClient.java:151
(Diff revision 1)
>          String info;
>          ExtendedJSONObject body;
>          try {
>              body = new SyncStorageResponse(response).jsonObjectBody();
>              // TODO: The service doesn't do the right thing yet :(
>              // body.throwIfFieldsMissingOrMisTyped(requiredErrorStringFields, String.class);

nit: not sure why this is still uncommented, but I'll go with it
Attachment #8738315 - Flags: review?(michael.l.comella) → review+
I think it really can be uncommented, considering it's a generic method checking types, but I don't want this to break without Nick around.

fwiw, fixing this could be a good first bug.
(In reply to Michael Comella (:mcomella) from comment #5)
> I think it really can be uncommented, considering it's a generic method
> checking types, but I don't want this to break without Nick around.
> 
> fwiw, fixing this could be a good first bug.

It throws because the service is (wrongly!) not including them when it should.  Try it; uncomment the @Ignore line at https://dxr.mozilla.org/mozilla-central/source/mobile/android/tests/background/junit4/src/org/mozilla/gecko/push/autopush/test/TestLiveAutopushClient.java#36 and run the tests.  (You may need to hand-hack the set of cipher suites -- just remove all the 20+ ones or something.)
https://hg.mozilla.org/mozilla-central/rev/3e85a84c7d68
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: