openrewrite / rewrite-analysis

OpenRewrite recipes for data flow analysis.
Apache License 2.0
8 stars 8 forks source link

Inner JavaVisitor in `findAllValues` to track multiple subtrees on left side of assignment #26

Open aaronist opened 1 year ago

aaronist commented 1 year ago

As of right now, findAllValues in VarAccess can traverse one layer on the subtree of a VarAccess to track value assignments on a variable like this.i. However, suppose we have the following case (where this.self == this and there exists a method called getSelf that returns self):

this.self.getSelf().self = this;

We would ultimately want to track values for this type of VarAccess with the inner JavaVisitor.