Closed Bug 1510970 Opened 6 years ago Closed 6 months ago

Java Warning: Redundant conditional expression

Categories

(GeckoView :: General, enhancement, P5)

Unspecified
Android
enhancement

Tracking

(firefox119 wontfix, firefox120 fixed)

RESOLVED FIXED
120 Branch
Tracking Status
firefox119 --- wontfix
firefox120 --- fixed

People

(Reporter: fluffyemily, Assigned: Logan)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug)

Attachments

(1 file)

Reports conditional expressions which can be replaced by simpler but equivalent expressions. 
Example
→
Replacement
condition ? true : false

condition
condition ? false : true

!condition
value == null ? null : value

value
result != 0 ? result : 0

result
a == b ? a : b

b

Affected Classes:

GeckoRuntimeSettings
GeckoSurface
Keywords: good-first-bug
OS: Unspecified → Android
Priority: -- → P5
Product: Firefox for Android → GeckoView

Hello, can I contribute to this bug?

Flags: needinfo?(amoya)

This bug is still relevant:

https://searchfox.org/mozilla-central/search?q=%3F+true&path=.java&case=true&regexp=false

mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoSurface.java
46 mIsSingleBuffer = p.readByte() == 1 ? true : false;
47 mIsAvailable = (p.readByte() == 1 ? true : false);

mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
657 return mWebFonts.get() != 0 ? true : false;

Severity: normal → N/A
Flags: needinfo?(amoya)
Assignee: nobody → loganrosen
Status: NEW → ASSIGNED

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit BugBot documentation.

Assignee: loganrosen → nobody
Status: ASSIGNED → NEW
Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/e9671bf4fb2b
simplify redundant conditional expressions r=geckoview-reviewers,owlish
Assignee: nobody → loganrosen
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: