[java-refactoring] isFirstUse: take PsiAssignmentExpression into account

Fixes IDEA-361852 Java Inline Method refactor introduces intermediate variables


(cherry picked from commit 680fbb62f3440b7ae29f4de1793260fe5be0ab36)

IJ-CR-149087

GitOrigin-RevId: c9ede4356696412b656b0295f21f534cce04bc30
This commit is contained in:
Tagir Valeev
2024-11-11 14:22:35 +01:00
committed by intellij-monorepo-bot
parent cc45672e28
commit 6fe3ec50ef
4 changed files with 39 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
import java.util.List;
public class Foo {
public Foo hi() {
System.out.println("hi");
return this;
}
public Foo hiTwice() {
return hi().hi();
}
public static void main(String[] args) {
new Foo().hi().<caret>hiTwice().hi();
}
}

View File

@@ -0,0 +1,11 @@
public class Foo {
public Foo hi() {
System.out.println("hi");
return this;
}
public static void main(String[] args) {
new Foo().hi().hi().hi().hi();
}
}