public void computeDiff()

in src/main/java/org/apache/sling/feature/diff/impl/FrameworkPropertiesComparator.java [36:58]


    public void computeDiff(Map<String, String> previous, Map<String, String> current, Feature target) {
        for (Entry<String, String> previousEntry : previous.entrySet()) {
            String previousKey = previousEntry.getKey();

            if (!current.containsKey(previousKey)) {
                target.getPrototype().getFrameworkPropertiesRemovals().add(previousKey);
            } else {
                String previousValue = previousEntry.getValue();
                String currentValue = current.get(previousKey);

                // override the previous set value
                if (!Objects.equals(previousValue, currentValue)) {
                    target.getFrameworkProperties().put(previousKey, currentValue);
                }
            }
        }

        for (Entry<String, String> currentEntry : current.entrySet()) {
            if (!previous.containsKey(currentEntry.getKey())) {
                target.getFrameworkProperties().put(currentEntry.getKey(), currentEntry.getValue());
            }
        }
    }