mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
instance variable initialization: don't warn on nullables (IDEA-120189)
This commit is contained in:
+4
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.siyeh.ig.initialization;
|
||||
|
||||
import com.intellij.codeInsight.NullableNotNullManager;
|
||||
import com.intellij.codeInsight.daemon.ImplicitUsageProvider;
|
||||
import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
@@ -93,6 +94,9 @@ public class InstanceVariableInitializationInspection extends BaseInspection {
|
||||
if (field.getInitializer() != null) {
|
||||
return;
|
||||
}
|
||||
if (NullableNotNullManager.isNullable(field)) {
|
||||
return;
|
||||
}
|
||||
if (m_ignorePrimitives) {
|
||||
final PsiType fieldType = field.getType();
|
||||
if (ClassUtils.isPrimitive(fieldType)) {
|
||||
|
||||
+4
@@ -99,4 +99,8 @@ class D {
|
||||
D() {
|
||||
for (Object o : l = new java.util.ArrayList()) {}
|
||||
}
|
||||
}
|
||||
class WithNullable {
|
||||
@org.jetbrains.annotations.Nullable
|
||||
private String str;
|
||||
}
|
||||
Reference in New Issue
Block a user