Java: Improved inspection "Join Declaration And Assignment" - corner case handled (IDEA-177132)

This commit is contained in:
Pavel Dolgov
2018-10-05 17:34:02 +03:00
parent 4aa8ef5500
commit 0dcbd3f6e5
4 changed files with 49 additions and 30 deletions
@@ -3,7 +3,7 @@ class Test {
{/*comment 1*//*comment 2*//*comment 3*/// comment 4
// comment A
/*comment B*/
/*comment C*/
String ss = "hello" + /*comment D*/ " world";/*comment E*/// comment F
/*comment C*//*comment E*/
String ss = "hello" + /*comment D*/ " world";// comment F
}
}
@@ -0,0 +1,8 @@
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
class C {
int foo(int x) {
int b = System.in.read();
int a = x + 1;/*A*//*B*/// C
return a + b;
}
}
@@ -0,0 +1,9 @@
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
class C {
int foo(int x) {
int <caret>a;
int b = System.in.read();
a = x + 1; /*A*/ /*B*/ // C
return a + b;
}
}