Annotation () { PluginException.reportDeprecatedUsage("AnnotationBuilder#createAnnotation", "Use `#create()` instead"); if (range == null) { range = myCurrentElement.getTextRange(); } if (tooltip == null && message != null) { tooltip = XmlStringUtil.wrapInHtml(XmlStringUtil.escapeString(message)); } //noinspection deprecation Annotation annotation = new Annotation(range.getStartOffset(), range.getEndOffset(), severity, message, tooltip); if (needsUpdateOnTyping != null) { annotation.setNeedsUpdateOnTyping(needsUpdateOnTyping); } if (highlightType != null) { annotation.setHighlightType(highlightType); } if (textAttributesKey != null) { annotation.setTextAttributes(textAttributesKey); } if (enforcedAttributes != null) { annotation.setEnforcedTextAttributes(enforcedAttributes); } if (problemGroup != null) { annotation.setProblemGroup(problemGroup); } if (gutterIconRenderer != null) { annotation.setGutterIconRenderer(gutterIconRenderer); } if (fileLevel != null) { annotation.setFileLevelAnnotation(fileLevel); } if (afterEndOfLine != null) { annotation.setAfterEndOfLine(afterEndOfLine); } if (fixes != null) { for (FixB fb : fixes) { IntentionAction fix = fb.fix; TextRange finalRange = fb.range == null ? this.range : fb.range; if (fb.batch != null && fb.batch) { registerBatchFix(annotation, fix, finalRange, fb.key); } else if (fb.universal != null && fb.universal) { registerBatchFix(annotation, fix, finalRange, fb.key); annotation.registerFix(fix, finalRange, fb.key); } else { annotation.registerFix(fix, finalRange, fb.key); } } } myHolder.add(annotation); myHolder.annotationCreatedFrom(this); return annotation; }