Last Comment Bug 714713 - Comparison of strings using ==
: Comparison of strings using ==
Status: RESOLVED FIXED
:
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: unspecified
: x86 Linux
: -- normal (vote)
: Firefox 12
Assigned To: Mark Finkle (:mfinkle) (use needinfo?)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-02 21:27 PST by Mark Finkle (:mfinkle) (use needinfo?)
Modified: 2012-01-06 22:12 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed
fixed


Attachments
patch (2.02 KB, patch)
2012-01-02 21:27 PST, Mark Finkle (:mfinkle) (use needinfo?)
dougt: review-
Details | Diff | Splinter Review
patch 2 (2.01 KB, patch)
2012-01-03 07:16 PST, Mark Finkle (:mfinkle) (use needinfo?)
dougt: review+
akeybl: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Mark Finkle (:mfinkle) (use needinfo?) 2012-01-02 21:27:51 PST
Created attachment 585352 [details] [diff] [review]
patch

AFAIK, we can only use String1.equal(String2) to compare strings in Java, unless the strings are constants.

This patch fixes 2 places I found that use ==
Comment 1 Mark Finkle (:mfinkle) (use needinfo?) 2012-01-02 22:00:29 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/0284b1ff46c6
Comment 2 Mark Finkle (:mfinkle) (use needinfo?) 2012-01-02 23:21:11 PST
had to backout because of some NullPointerException (mLastUri and mLastTitle can be null)

https://hg.mozilla.org/integration/mozilla-inbound/rev/1d00e560e0dc

I'll get a new patch soon
Comment 3 Mark Finkle (:mfinkle) (use needinfo?) 2012-01-03 07:16:06 PST
Created attachment 585406 [details] [diff] [review]
patch 2

This patch uses mUri.equals, since mUri is not null. I also dropped the mTitle check since mUri is unique enough.

This patch passed Try server
Comment 4 Mark Finkle (:mfinkle) (use needinfo?) 2012-01-03 09:24:12 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/c90dc56f83f0
Comment 5 Marco Bonardo [::mak] (Away 6-20 Aug) 2012-01-04 04:43:52 PST
https://hg.mozilla.org/mozilla-central/rev/c90dc56f83f0
Comment 6 Mark Finkle (:mfinkle) (use needinfo?) 2012-01-06 06:24:52 PST
Comment on attachment 585406 [details] [diff] [review]
patch 2

[Approval Request Comment]
Code cleanup. No risk

Uses the correct method to compare strings. The SnapshotSessionRunnable code could have been being called too often before this patch.
Comment 7 Alex Keybl [:akeybl] 2012-01-06 11:09:53 PST
Comment on attachment 585406 [details] [diff] [review]
patch 2

[Triage Comment]
Mobile only - approved for Aurora.
Comment 8 Mark Finkle (:mfinkle) (use needinfo?) 2012-01-06 22:12:24 PST
https://hg.mozilla.org/releases/mozilla-aurora/rev/5e4a83c69eef

Note You need to log in before you can comment on or make changes to this bug.