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
which throws null exception because the condition is evaluated as (condition1 && conction2) || condition3. (condition1 && conction2) is false and so condition3 will be evaluated.
so that the evaluation is condition1 && (condition2 || condition3) and if condition1 is false then (condition2 || condition3) won't be evaluated at all.
The text was updated successfully, but these errors were encountered:
mary-georgiou-sonarsource
changed the title
Fix S1125: Codefix Should set correct condition priority by adding parentheses.
Fix S1125: Codefix should set correct condition priority by adding parentheses.
Jun 19, 2023
The statement
get fixed to:
which throws null exception because the condition is evaluated as
(condition1 && conction2) || condition3
.(condition1 && conction2)
isfalse
and socondition3
will be evaluated.It should be fixed to:
so that the evaluation is
condition1 && (condition2 || condition3)
and ifcondition1
is false then(condition2 || condition3)
won't be evaluated at all.The text was updated successfully, but these errors were encountered: