mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
Java: Look for redundant assignment of a field in class and field initializers (IDEA-149587)
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
// "Remove redundant assignment" "true"
|
||||
class A {
|
||||
static int n;
|
||||
static {
|
||||
}
|
||||
static { n = 2; }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Remove redundant initializer" "true"
|
||||
class A {
|
||||
int n;
|
||||
{ n = 1; }
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Remove redundant assignment" "true"
|
||||
class A {
|
||||
static int n;
|
||||
static { <caret>n = 1; }
|
||||
static { n = 2; }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Remove redundant initializer" "true"
|
||||
class A {
|
||||
int n = <caret>0;
|
||||
{ n = 1; }
|
||||
}
|
||||
Reference in New Issue
Block a user