Closed Bug 1261985 Opened 8 years ago Closed 5 years ago

[infer] Errors in SearchEngine

Categories

(Firefox for Android Graveyard :: General, defect)

Unspecified
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INACTIVE

People

(Reporter: mcomella, Assigned: shanedharan, Mentored)

References

Details

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

Attachments

(1 file, 1 obsolete file)

/var/lib/jenkins/workspace/fennec-infer/mobile/android/base/java/org/mozilla/gecko/search/SearchEngine.java:232: error: NULL_DEREFERENCE
  object resultsUri last assigned on line 229 could be null and is dereferenced at line 232
Hi can I work on this bug? Seems like I should just check for null before iterating through the set?
How would I recreate the error?
Flags: needinfo?(michael.l.comella)
(In reply to Shane Dharan from comment #2)
> How would I recreate the error?

Unfortunately, I don't know how to run Infer locally. We run it in automation and the results are posted to [1] (daily?) so we can just make your change, land it, and ensure it's fixed via [1].

[1]: https://people.mozilla.org/~sledru/reports/fennec-infer/bugs.txt
Flags: needinfo?(michael.l.comella)
Attached patch nullSearchPatch.diff (obsolete) — Splinter Review
Added a null check for empty searches.

If you find any issues let me know :)
Flags: needinfo?(michael.l.comella)
Assignee: nobody → shanedharan
Flags: needinfo?(michael.l.comella)
Comment on attachment 8778095 [details] [diff] [review]
nullSearchPatch.diff

By the way, instead of NI requests for code reviews, you can set a review flag by clicking into "Details", selecting the field next to review, changing it to "?", and selecting me as a reviewer.
Attachment #8778095 - Flags: review?(michael.l.comella)
Comment on attachment 8778095 [details] [diff] [review]
nullSearchPatch.diff

Review of attachment 8778095 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good once the style nit is fixed! Please post another patch & flag me for review when you're ready.

To test functionality, I made a push to our try test server (above). If it's all green, we'll be able to land once the new patch is reviewed.

::: mobile/android/base/java/org/mozilla/gecko/search/SearchEngine.java
@@ +227,4 @@
>       */
>      public String queryForResultsUrl(String url) {
>          final Uri resultsUri = getResultsUri();
> +        if(resultsUri == null) {

nit: space after if, i.e. `if (`

If you run checkstyle (via `./mach gradle app:checkstyle`), it should catch issues like this.
Attachment #8778095 - Flags: review?(michael.l.comella) → feedback+
Changed the coding style :)
Attachment #8778095 - Attachment is obsolete: true
Attachment #8778711 - Flags: review?(michael.l.comella)
Comment on attachment 8778711 [details] [diff] [review]
nullSearchPatch.diff

Review of attachment 8778711 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good and thanks for the patch. Sorry about that delay.

You can add the "checkin-needed" keyword [1] to get your patch checked in. Note that all patches added via checkin-needed keyword need an associated green try run. Your patch has a few intermittent errors but they should be fine for checkin.

[1]: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/How_to_Submit_a_Patch#Getting_the_patch_checked_into_the_tree
Attachment #8778711 - Flags: review?(michael.l.comella) → review+

No action for a while, closing.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INACTIVE
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

Creator:
Created:
Updated:
Size: