mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inline parameter: allow inlining with different call sites
GitOrigin-RevId: 4d580bcd0f80076921111eae235f167fa98058f5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5eb49a4db7
commit
948ebcc12e
@@ -99,9 +99,7 @@ public class InlineParameterHandler extends JavaInlineActionHandler {
|
||||
if (expressions.length <= index) return false;
|
||||
PsiExpression argument = expressions[index];
|
||||
if (!refInitializer.isNull()) {
|
||||
return argument != null
|
||||
&& PsiEquivalenceUtil.areElementsEquivalent(refInitializer.get(), argument)
|
||||
&& PsiEquivalenceUtil.areElementsEquivalent(refMethodCall.get(), methodCall);
|
||||
return argument != null && PsiEquivalenceUtil.areElementsEquivalent(refInitializer.get(), argument);
|
||||
}
|
||||
if (InlineToAnonymousConstructorProcessor.isConstant(argument) || getReferencedFinalField(argument) != null) {
|
||||
if (refConstantInitializer.isNull()) {
|
||||
|
||||
@@ -2,12 +2,12 @@ public class Subject {
|
||||
private int myInt;
|
||||
private int t;
|
||||
|
||||
public void wp(int <caret>p) {
|
||||
public void wp(String s, int <caret>p) {
|
||||
myInt += p;
|
||||
}
|
||||
|
||||
void foo() {
|
||||
wp(t);
|
||||
wp(t);
|
||||
wp("s1", t);
|
||||
wp("s2", t);
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -2,12 +2,12 @@ public class Subject {
|
||||
private int myInt;
|
||||
private int t;
|
||||
|
||||
public void wp() {
|
||||
public void wp(String s) {
|
||||
myInt += t;
|
||||
}
|
||||
|
||||
void foo() {
|
||||
wp();
|
||||
wp();
|
||||
wp("s1");
|
||||
wp("s2");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user