SLING-6376 log correct types when adapting within a collection failed for some reason
authorKonrad Windszus <kwin@apache.org>
Thu, 8 Dec 2016 11:24:12 +0000 (11:24 +0000)
committerKonrad Windszus <kwin@apache.org>
Thu, 8 Dec 2016 11:24:12 +0000 (11:24 +0000)
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1773216 13f79535-47bb-0310-9956-ffa450edef68

src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java

index 9582daa..db8d00d 100644 (file)
@@ -876,13 +876,13 @@ public class ModelAdapterFactory implements AdapterFactory, Runnable, ModelFacto
                                 result.add(adapted);
                             } else {
                                 return new Result<Object>(new ModelClassException(
-                                    String.format("Could not adapt from %s to %s within the collection", value.getClass(), type)));
+                                    String.format("Could not adapt from %s to %s within the collection!", valueObject, parameterizedType.getActualTypeArguments()[0])));
                             }
                         }
                     }
                     adaptedValue = result;
                 } else {
-                    return new Result<Object>(new ModelClassException(String.format("%s is neither a parametrized Collection or List",
+                    return new Result<Object>(new ModelClassException(String.format("%s is neither a parameterized Collection or List",
                         type)));
                 }
             } else {