Search in sources :

Example 1 with StringConcatenateAssignmentNode

use of org.checkerframework.dataflow.cfg.node.StringConcatenateAssignmentNode in project checker-framework by typetools.

the class CFAbstractTransfer method visitStringConcatenateAssignment.

@Override
public TransferResult<V, S> visitStringConcatenateAssignment(StringConcatenateAssignmentNode n, TransferInput<V, S> in) {
    // This gets the type of LHS + RHS
    TransferResult<V, S> result = super.visitStringConcatenateAssignment(n, in);
    Node lhs = n.getLeftOperand();
    Node rhs = n.getRightOperand();
    // update the results store if the assignment target is something we can
    // process
    S info = result.getRegularStore();
    // ResultValue is the type of LHS + RHS
    V resultValue = result.getResultValue();
    if (lhs instanceof FieldAccessNode && shouldPerformWholeProgramInference(n.getTree(), lhs.getTree())) {
        // Updates inferred field type
        analysis.atypeFactory.getWholeProgramInference().updateInferredFieldType((FieldAccessNode) lhs, rhs, analysis.getContainingClass(n.getTree()), analysis.getTypeFactory());
    }
    processCommonAssignment(in, lhs, rhs, info, resultValue);
    return new RegularTransferResult<>(finishValue(resultValue, info), info);
}
Also used : ThisLiteralNode(org.checkerframework.dataflow.cfg.node.ThisLiteralNode) StringConversionNode(org.checkerframework.dataflow.cfg.node.StringConversionNode) WideningConversionNode(org.checkerframework.dataflow.cfg.node.WideningConversionNode) ClassNameNode(org.checkerframework.dataflow.cfg.node.ClassNameNode) ObjectCreationNode(org.checkerframework.dataflow.cfg.node.ObjectCreationNode) LocalVariableNode(org.checkerframework.dataflow.cfg.node.LocalVariableNode) NarrowingConversionNode(org.checkerframework.dataflow.cfg.node.NarrowingConversionNode) EqualToNode(org.checkerframework.dataflow.cfg.node.EqualToNode) VariableDeclarationNode(org.checkerframework.dataflow.cfg.node.VariableDeclarationNode) TernaryExpressionNode(org.checkerframework.dataflow.cfg.node.TernaryExpressionNode) AssignmentNode(org.checkerframework.dataflow.cfg.node.AssignmentNode) CaseNode(org.checkerframework.dataflow.cfg.node.CaseNode) FieldAccessNode(org.checkerframework.dataflow.cfg.node.FieldAccessNode) NotEqualNode(org.checkerframework.dataflow.cfg.node.NotEqualNode) ArrayAccessNode(org.checkerframework.dataflow.cfg.node.ArrayAccessNode) ConditionalNotNode(org.checkerframework.dataflow.cfg.node.ConditionalNotNode) ReturnNode(org.checkerframework.dataflow.cfg.node.ReturnNode) MethodInvocationNode(org.checkerframework.dataflow.cfg.node.MethodInvocationNode) StringConcatenateAssignmentNode(org.checkerframework.dataflow.cfg.node.StringConcatenateAssignmentNode) Node(org.checkerframework.dataflow.cfg.node.Node) FieldAccessNode(org.checkerframework.dataflow.cfg.node.FieldAccessNode) RegularTransferResult(org.checkerframework.dataflow.analysis.RegularTransferResult)

Aggregations

RegularTransferResult (org.checkerframework.dataflow.analysis.RegularTransferResult)1 ArrayAccessNode (org.checkerframework.dataflow.cfg.node.ArrayAccessNode)1 AssignmentNode (org.checkerframework.dataflow.cfg.node.AssignmentNode)1 CaseNode (org.checkerframework.dataflow.cfg.node.CaseNode)1 ClassNameNode (org.checkerframework.dataflow.cfg.node.ClassNameNode)1 ConditionalNotNode (org.checkerframework.dataflow.cfg.node.ConditionalNotNode)1 EqualToNode (org.checkerframework.dataflow.cfg.node.EqualToNode)1 FieldAccessNode (org.checkerframework.dataflow.cfg.node.FieldAccessNode)1 LocalVariableNode (org.checkerframework.dataflow.cfg.node.LocalVariableNode)1 MethodInvocationNode (org.checkerframework.dataflow.cfg.node.MethodInvocationNode)1 NarrowingConversionNode (org.checkerframework.dataflow.cfg.node.NarrowingConversionNode)1 Node (org.checkerframework.dataflow.cfg.node.Node)1 NotEqualNode (org.checkerframework.dataflow.cfg.node.NotEqualNode)1 ObjectCreationNode (org.checkerframework.dataflow.cfg.node.ObjectCreationNode)1 ReturnNode (org.checkerframework.dataflow.cfg.node.ReturnNode)1 StringConcatenateAssignmentNode (org.checkerframework.dataflow.cfg.node.StringConcatenateAssignmentNode)1 StringConversionNode (org.checkerframework.dataflow.cfg.node.StringConversionNode)1 TernaryExpressionNode (org.checkerframework.dataflow.cfg.node.TernaryExpressionNode)1 ThisLiteralNode (org.checkerframework.dataflow.cfg.node.ThisLiteralNode)1 VariableDeclarationNode (org.checkerframework.dataflow.cfg.node.VariableDeclarationNode)1