Skip to content

Commit

Permalink
Do not try to set a default for Collection fields in Sling Models
Browse files Browse the repository at this point in the history
This prevents the error "WARN
org.apache.sling.models.impl.ModelAdapterFactory - Cannot provide
default for java.util.List<java.lang.String>" being issued due to
https://issues.apache.org/jira/browse/SLING-11812

This closes #3209
  • Loading branch information
kwin committed Nov 15, 2023
1 parent e5b4df5 commit d7b4dd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<java.lang.String>

## 6.3.0 - 2023-10-25

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

@Model(
Expand All @@ -53,7 +54,6 @@ public class DispatcherFlushModelImpl implements DispatcherFlusherModel {
private String replicationActionType;

@ValueMapValue
@Default(values = {})
private List<String> paths;

@Override
Expand All @@ -63,7 +63,7 @@ public String getActionType() {

@Override
public Collection<String> getPaths() {
return paths;
return paths != null ? paths : Collections.emptyList();
}

@Override
Expand Down

0 comments on commit d7b4dd5

Please sign in to comment.