You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2025/06/18 13:33:13 UTC

(sling-org-apache-sling-models-impl) 01/01: Injector wrongly logs that a field is required, while optional state is validated by the ModelAdapterFactory

This is an automated email from the ASF dual-hosted git repository.

royteeuwen pushed a commit to branch bugfix/fix-wrong-log
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-impl.git

commit 316da08c4418e119d167f20920786966d6eabc33
Author: Roy Teeuwen <ro...@apache.org>
AuthorDate: Wed Jun 18 15:33:07 2025 +0200

    Injector wrongly logs that a field is required, while optional state is validated by the ModelAdapterFactory
---
 .../org/apache/sling/models/impl/injectors/ResourcePathInjector.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/models/impl/injectors/ResourcePathInjector.java b/src/main/java/org/apache/sling/models/impl/injectors/ResourcePathInjector.java
index fc65281..690a14d 100644
--- a/src/main/java/org/apache/sling/models/impl/injectors/ResourcePathInjector.java
+++ b/src/main/java/org/apache/sling/models/impl/injectors/ResourcePathInjector.java
@@ -117,8 +117,8 @@ public class ResourcePathInjector extends AbstractInjector
             if (resource != null) {
                 resources.add(resource);
             } else {
-                LOG.warn(
-                        "Could not retrieve resource at path {} for field {}. Since it is required it won't be injected.",
+                LOG.debug(
+                        "Could not retrieve resource at path {} for field {}.",
                         path,
                         fieldName);
                 // all resources should've been injected. we stop