java: split declaration & assignment: fix for very broken code (IDEA-254385)

forcePsiPostprocessAndRestoreElement may invalidate variable initializer

GitOrigin-RevId: 31b99804e5603cff36494ecbf9f98c1716b13d22
This commit is contained in:
Anna Kozlova
2020-11-02 20:18:09 +00:00
committed by intellij-monorepo-bot
parent 84e10e37b0
commit f8a53347cf
3 changed files with 25 additions and 1 deletions
@@ -0,0 +1,11 @@
// "Split into declaration and assignment" "true"
class Foo {
{
int fieldIndexes;
fieldIndexes = getFieldIndexes(Hellonew String[;]{""});
}
public int getFieldIndexes(String[] columns) {
return 0;
}
}
@@ -0,0 +1,10 @@
// "Split into declaration and assignment" "true"
class Foo {
{
<caret>int fieldIndexes = getFieldIndexes(Hellonew String[]{""});
}
public int getFieldIndexes(String[] columns) {
return 0;
}
}