mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inline parameter: conflict if initializer depends on caller parameter
This commit is contained in:
+2
@@ -177,6 +177,8 @@ public class InlineParameterExpressionProcessor extends BaseRefactoringProcessor
|
||||
if (!mySameClass && !((PsiModifierListOwner)element).hasModifierProperty(PsiModifier.STATIC)) {
|
||||
conflicts.putValue(expression, "Parameter initializer depend on non static member from some other class");
|
||||
}
|
||||
} else if (element instanceof PsiParameter) {
|
||||
conflicts.putValue(expression, "Parameter initializer depends on callers parameter");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class Outer {
|
||||
public void withClass(Object <caret>o) {
|
||||
System.out.println(o.toString());
|
||||
}
|
||||
|
||||
public void foor(Object objct) {
|
||||
withClass(objct);
|
||||
}
|
||||
}
|
||||
@@ -148,6 +148,16 @@ public class InlineParameterTest extends LightCodeInsightTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testRefCallerParameter() throws Exception {
|
||||
try {
|
||||
doTest(false);
|
||||
}
|
||||
catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
|
||||
assertEquals("Parameter initializer depends on callers parameter", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void testHandleExceptions() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user