void (@NotNull Project project, @NotNull PsiField field) { if (HighlightUtil.isSerializationImplicitlyUsedField(field)) { return; } if (field.hasModifierProperty(PsiModifier.PRIVATE)) { if (!myRefCountHolder.isReferenced(field) && !UnusedSymbolUtil.isImplicitUsage(myProject, field)) { message = JavaErrorBundle.message("private.field.is.not.used", field.getName()); suggestionsToMakeFieldUsed(field); if (!field.hasInitializer() && !field.hasModifierProperty(PsiModifier.FINAL)) { quickFixes.add(QuickFixFactory.getInstance().createCreateConstructorParameterFromFieldFix(field)); } return; } boolean readReferenced = myRefCountHolder.isReferencedForRead(field); if (!readReferenced && !UnusedSymbolUtil.isImplicitRead(project, field)) { message = getNotUsedForReadingMessage(field); suggestionsToMakeFieldUsed(field); return; } if (field.hasInitializer()) { return; } boolean writeReferenced = myRefCountHolder.isReferencedForWrite(field); if (!writeReferenced && !UnusedSymbolUtil.isImplicitWrite(project, field)) { message = JavaErrorBundle.message("private.field.is.not.assigned", field.getName()); quickFixes.add(QuickFixFactory.getInstance().createCreateGetterOrSetterFix(false, true, field)); if (!field.hasModifierProperty(PsiModifier.FINAL)) { quickFixes.add(QuickFixFactory.getInstance().createCreateConstructorParameterFromFieldFix(field)); } SpecialAnnotationsUtilBase.processUnknownAnnotations(field, annoName -> quickFixes.add(QuickFixFactory.getInstance().createAddToImplicitlyWrittenFieldsFix(project, annoName))); } } else if (!UnusedSymbolUtil.isFieldUsed(myProject, myFile, field, ProgressManager.getGlobalProgressIndicator(), myGlobalUsageHelper)) { if (UnusedSymbolUtil.isImplicitWrite(myProject, field)) { message = getNotUsedForReadingMessage(field); quickFixes.add(QuickFixFactory.getInstance().createSafeDeleteFix(field)); } else if (!UnusedSymbolUtil.isImplicitUsage(myProject, field)) { formatUnusedSymbolHighlightInfo(project, "field.is.not.used", field); } } }