Open
Bug 1510968
Opened 6 years ago
Updated 1 year ago
Java Warning: Unneccessary 'null' check before 'instanceof' expression
Categories
(GeckoView :: General, enhancement, P5)
Tracking
(Not tracked)
ASSIGNED
People
(Reporter: fluffyemily, Assigned: Logan)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug)
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Reports a null check followed by an instanceof check or a method call which will surely return false when null is passed (e.g. Class.isInstance). Since the instanceof operator always returns false for null, there is no need to have an additional null check.
Here is an example of a violation:
if (x != null && x instanceof String) { ... }
The quickfix changes this code to:
if (x instanceof String) { ... }
Affected Classes:
GeckoBundle
GeckoSessionTestRule
UiThreadUtils
WebRequestError
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Hi, I am new to open source development. Can I work on this issue?
Updated•6 years ago
|
Product: Firefox for Android → GeckoView
Updated•2 years ago
|
Severity: normal → S3
Assignee | ||
Comment 3•1 year ago
|
||
Updated•1 year ago
|
Assignee: nobody → loganrosen
Status: NEW → ASSIGNED
You need to log in
before you can comment on or make changes to this bug.
Description
•