Element (@NotNull Map<String, Element> inspectionElements, @NotNull String sourceToolName) { if (inspectionElements.containsKey(sourceToolName)) { return inspectionElements.get(sourceToolName); } if (sourceToolName.equals(OLD_MERGER_NAME)) {//need to merge initial tools to get merged redundant string operations return new InspectionElementsMergerBase(){ @NotNull @Override public String getMergedToolName() { return OLD_MERGER_NAME; } @Override public String @NotNull [] getSourceToolNames() { return OLD_SOURCE_NAMES.toArray(ArrayUtilRt.EMPTY_STRING_ARRAY); } @Override public Element merge(@NotNull Map<String, Element> inspectionElements) { return super.merge(inspectionElements); } @Override protected boolean writeMergedContent(@NotNull Element toolElement) { return true; } }.merge(inspectionElements); } else if (OLD_SOURCE_NAMES.contains(sourceToolName)) { Element merged = inspectionElements.get(OLD_MERGER_NAME); if (merged != null) { // RedundantStringOperation already replaced the content Element clone = merged.clone(); clone.setAttribute("class", sourceToolName); return clone; } } return null; }