mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
can be final: don't suggest final if field was not initialized (IDEA-167670)
This commit is contained in:
+1
@@ -161,6 +161,7 @@ public class CanBeFinalInspection extends GlobalJavaBatchInspectionTool {
|
||||
psiIdentifier = ((PsiMethod)psiMember).getNameIdentifier();
|
||||
}
|
||||
else if (refElement instanceof RefField) {
|
||||
if (!((RefField)refElement).isUsedForWriting()) return null;
|
||||
if (!isReportFields()) return null;
|
||||
psiIdentifier = ((PsiField)psiMember).getNameIdentifier();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>3</line>
|
||||
<description>Declaration can have final modifier</description>
|
||||
</problem>
|
||||
|
||||
</problems>
|
||||
<problems/>
|
||||
Reference in New Issue
Block a user