openrewrite / openrewrite/rewrite-analysis

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

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
16
Forks
12
Avg merge
2h 26m
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating VarAccess.findAllValues and reading how its current JavaVisitor traverses a VarAccess subtree. Trace the example this.self.getSelf().self = this and define done as tracking assignments across multiple left-side subtrees with the inner JavaVisitor, including the stated getSelf case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.