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
I'm working on getting NullAway to not crash in the presence of switch expressions, now that Checker dataflow does not crash for them. One small issue is that the marker node for a switch expression may not appear as a top-level node in the containing CFG block, so it never gets directly visited by the dataflow analysis. If I have a statement Object o = null;, I get four nodes in the corresponding CFG basic block: a VariableDeclarationNode, a NullLiteralNode, an AssignmentNode, and a LocalVariableNode. But, if I write Object o = switch (i) { ... };, I just get three nodes in the corresponding block: a VariableDeclarationNode, an AssignmentNode, and a LocalVariableNode; the marker node for the switch expression is missing.
I imagine the representation of switch expressions in CFGs is very temporary, and as it gets handled it will get its own node in the containing block for cases like these. And I can add a special case to work around this for now. Just wanted to note the issue.
The text was updated successfully, but these errors were encountered:
Update: given that switch expressions aren't yet properly represented in the CFG anyway, this issue doesn't really matter to us. If it's of no value it can just be closed.
I'm working on getting NullAway to not crash in the presence of switch expressions, now that Checker dataflow does not crash for them. One small issue is that the marker node for a switch expression may not appear as a top-level node in the containing CFG block, so it never gets directly visited by the dataflow analysis. If I have a statement
Object o = null;
, I get four nodes in the corresponding CFG basic block: aVariableDeclarationNode
, aNullLiteralNode
, anAssignmentNode
, and aLocalVariableNode
. But, if I writeObject o = switch (i) { ... };
, I just get three nodes in the corresponding block: aVariableDeclarationNode
, anAssignmentNode
, and aLocalVariableNode
; the marker node for the switch expression is missing.I imagine the representation of
switch
expressions in CFGs is very temporary, and as it gets handled it will get its own node in the containing block for cases like these. And I can add a special case to work around this for now. Just wanted to note the issue.The text was updated successfully, but these errors were encountered: