void (final PsiField field, final PsiFile boundForm, final AnnotationHolder holder) { holder.newSilentAnnotation(HighlightSeverity.INFORMATION).gutterIconRenderer(new BoundIconRenderer(field)).create(); LOG.assertTrue(boundForm instanceof PsiPlainTextFile); final PsiType guiComponentType = FormReferenceProvider.getGUIComponentType((PsiPlainTextFile)boundForm, field.getName()); if (guiComponentType != null) { final PsiType fieldType = field.getType(); if (!fieldType.isAssignableFrom(guiComponentType)) { String message = UIDesignerBundle.message("bound.field.type.mismatch", guiComponentType.getCanonicalText(), fieldType.getCanonicalText()); holder.newAnnotation(HighlightSeverity.ERROR, message).range(field.getTypeElement()) .withFix(new ChangeFormComponentTypeFix((PsiPlainTextFile)boundForm, field.getName(), field.getType())) .withFix(new ChangeBoundFieldTypeFix(field, guiComponentType)).create(); } } if (field.hasInitializer()) { final String message = UIDesignerBundle.message("field.is.overwritten.by.generated.code", field.getName()); PsiExpression initializer = Objects.requireNonNull(field.getInitializer()); holder.newAnnotation(HighlightSeverity.WARNING, message).range(initializer) .withFix(new DeleteElementFix(initializer, UIBundle.message("remove.field.initializer.quick.fix"))).create(); } }