LocalQuickFix (Object... infos) { final Object info = infos[0]; if (!(info instanceof PsiReferenceExpression referenceExpression)) { return null; } if (TypeUtils.isOptional(referenceExpression.getType())) { return null; } final PsiElement target = referenceExpression.resolve(); if (!(target instanceof PsiVariable variable)) { return null; } if (NullableNotNullManager.isNotNull(variable)) { return null; } final NullableNotNullManager manager = NullableNotNullManager.getInstance(target.getProject()); String annotation = manager.getDefaultNullable(); if (JavaPsiFacade.getInstance(variable.getProject()).findClass(annotation, variable.getResolveScope()) == null) { return null; } return new AddAnnotationPsiFix(annotation, variable); }