You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I faced ternary operators with Boolean objects as result:
condition ? Boolean.TRUE : something(); // can be as simple as condition || something()
Describe the solution you'd like
In my opinion, it would be a good solution to disable the use of this class. just like the boolean in the original rule.
The text was updated successfully, but these errors were encountered:
If something() returns null and you've refactored to condition || something() then your expression NPEs. This is not a problem with a boolean literal (eg condition ? true : (Boolean) null) because that code NPEs too.
I think maybe, UnnecessaryBoxing could carefully* look into whether Boolean.TRUE may be unboxed to true (which here it can't). If it can then SimplifiedTernary would flag it. I don't think this case should be added to SimplifiedTernary.
* boxing rules in ternaries with a primitive type are very complicated...
Is your feature request related to a problem? Please describe.
I faced ternary operators with Boolean objects as result:
Describe the solution you'd like
In my opinion, it would be a good solution to disable the use of this class. just like the boolean in the original rule.
The text was updated successfully, but these errors were encountered: