openrewrite / openrewrite/rewrite
Unable to detect type of chain method invocation
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 571
- Avg merge
- 13h 12m
- Merged PRs (30d)
- 261
Description
What version of OpenRewrite are you using?
I am using
- OpenRewrite v8.41.1
What is the smallest, simplest way to reproduce the problem?
For ObjectClassA.methodX().methodY()
methodX()returnObjectClassAmethodY()doesn't exist inClassB
After changing ObjectClassA to ObjectClassB, OpenRewrite can't detect the methodType of methodY() (the pattern should be ClassB methodY()
I suppose the issue is related to line 462
Here the code snippet you may need in my case (from httpclient4 to httpclient5):
HttpClientBuilder.create()
.setDefaultRequestConfig(config)
.setSSLSocketFactory(sslSocketFactory)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the type-attribution logic around the referenced line 462 and reproduce the chained invocation using ObjectClassA/ObjectClassB and the HttpClientBuilder example. Trace why methodY() lacks a methodType after the receiver changes; done means the invocation is attributed as ClassB methodY().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100