Closed Bug 1081599 Opened 10 years ago Closed 10 years ago

Don't check for null before an instanceof

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 35

People

(Reporter: ckitching, Assigned: ckitching)

Details

Attachments

(1 file)

null instanceof <anything> == false

As a result, things like:

if (x != null && x instanceof Toaster) { ... }

can lose the null check.
Attachment #8503706 - Flags: review?(rnewman)
Comment on attachment 8503706 [details] [diff] [review]
Don't check nullity before instanceof

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

Upstream needed.

::: mobile/android/base/LightweightTheme.java
@@ +342,5 @@
>              if (parent instanceof View) {
>                  curView = (View) parent;
>              }
>  
> +        } while(parent instanceof View);

Fix space while you're here.
Attachment #8503706 - Flags: review?(rnewman) → review+
https://hg.mozilla.org/mozilla-central/rev/0dc0ff9bb484
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 35
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.