Last Comment Bug 714713 - Comparison of strings using ==
: Comparison of strings using ==
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?)
: Sebastian Kaspari (:sebastian)
Depends on:
  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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (2.02 KB, patch)
2012-01-02 21:27 PST, Mark Finkle (:mfinkle) (use needinfo?)
doug.turner: review-
Details | Diff | Splinter Review
patch 2 (2.01 KB, patch)
2012-01-03 07:16 PST, Mark Finkle (:mfinkle) (use needinfo?)
doug.turner: 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]

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
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)

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
Comment 5 Marco Bonardo [::mak] 2012-01-04 04:43:52 PST
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

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