From d7b4dd5b3436f6f4963c27f49259e894fa36d6eb Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Wed, 15 Nov 2023 17:44:21 +0100 Subject: [PATCH] Do not try to set a default for Collection fields in Sling Models This prevents the error "WARN org.apache.sling.models.impl.ModelAdapterFactory - Cannot provide default for java.util.List" being issued due to https://issues.apache.org/jira/browse/SLING-11812 This closes #3209 --- CHANGELOG.md | 3 +++ .../replication/dispatcher/impl/DispatcherFlushModelImpl.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05007e5a0d..d712dfd20a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com) ## Unreleased ([details][unreleased changes details]) +## Added + +- #3209 - WARN org.apache.sling.models.impl.ModelAdapterFactory - Cannot provide default for java.util.List ## 6.3.0 - 2023-10-25 diff --git a/bundle/src/main/java/com/adobe/acs/commons/replication/dispatcher/impl/DispatcherFlushModelImpl.java b/bundle/src/main/java/com/adobe/acs/commons/replication/dispatcher/impl/DispatcherFlushModelImpl.java index 4b540724c6..8b38cae5d4 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/replication/dispatcher/impl/DispatcherFlushModelImpl.java +++ b/bundle/src/main/java/com/adobe/acs/commons/replication/dispatcher/impl/DispatcherFlushModelImpl.java @@ -33,6 +33,7 @@ import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.List; @Model( @@ -53,7 +54,6 @@ public class DispatcherFlushModelImpl implements DispatcherFlusherModel { private String replicationActionType; @ValueMapValue - @Default(values = {}) private List paths; @Override @@ -63,7 +63,7 @@ public String getActionType() { @Override public Collection getPaths() { - return paths; + return paths != null ? paths : Collections.emptyList(); } @Override