Class VariableReferences

java.lang.Object
org.openrewrite.staticanalysis.VariableReferences

public class VariableReferences extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<org.openrewrite.java.tree.Statement>
    findLhsReferences(org.openrewrite.java.tree.J j, org.openrewrite.java.tree.J.Identifier target)
     
    static List<org.openrewrite.java.tree.J>
    findRhsReferences(org.openrewrite.java.tree.J j, org.openrewrite.java.tree.J.Identifier target)
    An identifier is considered a right-hand side ("rhs") read operation if it is not used as the left operand of an assignment, nor as the operand of a stand-alone increment.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VariableReferences

      public VariableReferences()
  • Method Details

    • findRhsReferences

      public static List<org.openrewrite.java.tree.J> findRhsReferences(org.openrewrite.java.tree.J j, org.openrewrite.java.tree.J.Identifier target)
      An identifier is considered a right-hand side ("rhs") read operation if it is not used as the left operand of an assignment, nor as the operand of a stand-alone increment.
      Parameters:
      j - The subtree to search.
      target - A J.Identifier to check for usages.
      Returns:
      found J locations of "right-hand" read calls.
    • findLhsReferences

      public static List<org.openrewrite.java.tree.Statement> findLhsReferences(org.openrewrite.java.tree.J j, org.openrewrite.java.tree.J.Identifier target)
      Parameters:
      j - The subtree to search.
      target - A J.Identifier to check for usages.
      Returns:
      found Statement locations of "left-hand" assignment write calls.