mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
Java: Improved inspection "Join Declaration And Assignment" (IDEA-177132)
This commit is contained in:
+1
-5
@@ -1,10 +1,6 @@
|
||||
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
|
||||
class Test {
|
||||
{
|
||||
/*comment 1*/
|
||||
/*comment 2*/
|
||||
/*comment 3*/
|
||||
// comment 4
|
||||
{/*comment 1*//*comment 2*//*comment 3*/// comment 4
|
||||
// comment A
|
||||
/*comment B*/
|
||||
/*comment C*/
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
|
||||
class C {
|
||||
void foo() {
|
||||
/*comment 1*/
|
||||
bar();/*comment 2*//*comment 3*///comment 4
|
||||
// comment A
|
||||
/*comment B*/
|
||||
int n = 1;// comment C
|
||||
}
|
||||
void bar(){}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
|
||||
class C {
|
||||
void foo() {
|
||||
bar();
|
||||
int n = 1;
|
||||
}
|
||||
void bar(){}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Join declaration and assignment" "false"
|
||||
class C {
|
||||
void foo(int[] a) {
|
||||
for (int n = 0; ; <caret>n+=1) {
|
||||
if (n >= a.length) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
|
||||
class C {
|
||||
void foo() {
|
||||
/*comment 1*/int /*comment 2*/ n /*comment 3*/; //comment 4
|
||||
bar();
|
||||
// comment A
|
||||
/*comment B*/
|
||||
<caret>n = 1; // comment C
|
||||
}
|
||||
void bar(){}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Join declaration and assignment" "GENERIC_ERROR_OR_WARNING"
|
||||
class C {
|
||||
void foo() {
|
||||
int n;
|
||||
bar();
|
||||
<caret>n = 1;
|
||||
}
|
||||
void bar(){}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Join declaration and assignment" "false"
|
||||
class C {
|
||||
void foo() throws Exception {
|
||||
int n = System.in.read();
|
||||
bar();
|
||||
<caret>n = 1;
|
||||
}
|
||||
void bar(){}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Join declaration and assignment" "false"
|
||||
class C {
|
||||
void foo() {
|
||||
int n = 0;
|
||||
bar(n);
|
||||
<caret>n = 1;
|
||||
}
|
||||
void bar(int i){}
|
||||
}
|
||||
Reference in New Issue
Block a user