Java: Improved inspection "Join Declaration And Assignment" - handle C-style array declarations (IDEA-177132)

This commit is contained in:
Pavel Dolgov
2018-10-09 15:08:01 +03:00
parent 049cea0c10
commit a2c0f2202c
5 changed files with 33 additions and 23 deletions
@@ -0,0 +1,6 @@
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
class Test {
{
int[] a = new int[0];
}
}
@@ -2,9 +2,9 @@
class Test {
{
// comment A
/*comment B*/ /*comment 1*/ /*comment 2*/ /*comment 3*/ // comment 4
/*comment B*/ // comment 4
/*comment C*/
/*comment E*/
String ss = "hello" + /*comment D*/ " world"; // comment F
String /*comment 1*/ ss /*comment 2*/ /*comment 3*/ = "hello" + /*comment D*/ " world"; // comment F
}
}
@@ -5,10 +5,8 @@ class C {
bar();
// comment A
/*comment B*/
/*comment 2*/
/*comment 3*/
//comment 4
int n = 1; // comment C
int /*comment 2*/ n /*comment 3*/ = 1; // comment C
}
void bar(){}
}
@@ -0,0 +1,7 @@
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
class Test {
{
int a[];
<caret>a = new int[0];
}
}