Open Bug 1510968 Opened 6 years ago Updated 1 year ago

Java Warning: Unneccessary 'null' check before 'instanceof' expression

Categories

(GeckoView :: General, enhancement, P5)

Unspecified
Android
enhancement

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: fluffyemily, Assigned: Logan)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug)

Attachments

(1 file)

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
Keywords: good-first-bug
OS: Unspecified → Android
Priority: -- → P5
Hi, I am new to open source development. Can I work on this issue?
Product: Firefox for Android → GeckoView
Severity: normal → S3

Enhancements should have severity N/A.

Severity: S3 → N/A
Assignee: nobody → loganrosen
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: