void (@NotNull TextEditorHighlightingPass pass, @NotNull Int2ObjectMap<TextEditorHighlightingPass> id2Pass) { int oldId = pass.getId(); int id; if (oldId == -1 || oldId == 0) { id = getNextAvailablePassId(); pass.setId(id); } else { id = oldId; } TextEditorHighlightingPass prevPass = id2Pass.put(id, pass); if (prevPass != null) { LOG.error("Duplicate pass id found: "+id+". Both passes returned the same getId(): "+prevPass+" ("+prevPass.getClass() +") and "+pass+" ("+pass.getClass()+"). oldId="+oldId); } }