mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
field can be final: skip uninitialized fields used in class initializers (IDEA-156452)
This commit is contained in:
+2
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems/>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class G {
|
||||
private Object foo;
|
||||
{
|
||||
System.out.println(foo);
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@ public class FieldCanBeLocalTest extends InspectionTestCase {
|
||||
public void testFieldUsedForWritingInLambda() throws Exception {doTest();}
|
||||
public void testStaticQualifiedFieldAccessForWriting() throws Exception {doTest();}
|
||||
public void testFieldReferencedFromAnotherObject() throws Exception {doTest();}
|
||||
public void testFieldNonInitializedUsedInClassInitializer() throws Exception {doTest();}
|
||||
public void testIgnoreAnnotated() throws Exception {
|
||||
final FieldCanBeLocalInspection inspection = new FieldCanBeLocalInspection();
|
||||
doTestConfigured(inspection);
|
||||
|
||||
Reference in New Issue
Block a user