void (@NotNull List<? extends ArrangementEntryDependencyInfo> fieldDependencyRoots, @NotNull ArrangementSettings settings, @NotNull JavaArrangementParseInfo parseInfo) { Collection<JavaElementArrangementEntry> fields = parseInfo.getFields(); List<JavaElementArrangementEntry> arrangedFields = ArrangementEngine.arrange(fields, settings.getSections(), settings.getRulesSortedByPriority(), null); for (ArrangementEntryDependencyInfo root : fieldDependencyRoots) { JavaElementArrangementEntry anchorField = root.getAnchorEntry(); final int anchorEntryIndex = arrangedFields.indexOf(anchorField); for (ArrangementEntryDependencyInfo fieldInInitializerInfo : root.getDependentEntriesInfos()) { JavaElementArrangementEntry fieldInInitializer = fieldInInitializerInfo.getAnchorEntry(); if (arrangedFields.indexOf(fieldInInitializer) > anchorEntryIndex || fieldInInitializerInfo.getDependentEntriesInfos().size() > 0) { anchorField.addDependency(fieldInInitializer); } } } }