split declaration: detect same variables after declaration (IDEA-175261)

This commit is contained in:
Anna.Kozlova
2017-07-04 10:28:25 +02:00
parent d55416e473
commit 006b9b1742
5 changed files with 65 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
// "Split into declaration and assignment" "true"
class Test {
{
int i;
for (i = 0; i<10; i++) {
System.out.println();
}
new Runnable() {
{
int i = 0;
}
};
}
}

View File

@@ -0,0 +1,14 @@
// "Split into declaration and assignment" "true"
class Test {
{
for (int i<caret>=0; i<10; i++) {
System.out.println();
}
new Runnable() {
{
int i = 0;
}
};
}
}

View File

@@ -0,0 +1,9 @@
// "Split into declaration and assignment" "false"
class Test {
{
for (int i<caret>=0; i<10; i++) {
System.out.println();
}
Runnable r = () -> {int i = 0;};
}
}