You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Justin Edelson (JIRA)" <ji...@apache.org> on 2014/05/13 21:16:18 UTC

[jira] [Assigned] (SLING-3547) Default handling for numerical types on Sling Models broken

     [ https://issues.apache.org/jira/browse/SLING-3547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Edelson reassigned SLING-3547:
-------------------------------------

    Assignee: Justin Edelson

> Default handling for numerical types on Sling Models broken
> -----------------------------------------------------------
>
>                 Key: SLING-3547
>                 URL: https://issues.apache.org/jira/browse/SLING-3547
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Sling Models Implementation 1.0.2
>            Reporter: Konrad Windszus
>            Assignee: Justin Edelson
>
> Currently all default annotations on numeric types lead to the following warning: 
> org.apache.sling.models.impl.ModelAdapterFactory Default values for class java.lang.Boolean are not supported and the default is not used.
> This is due to the fact that first all types are converted from Primitives to Object Wrapper Classes (in mapPrimitiveClasses). Then the comparison against that type only considers Primitives (in getDefaultValue, except for Strings), which obviously failed, because either those were Object Wrapper Classes right from the beginning, or they were converted to those. 
> In my regard you should compare the Type against e.g. Integer.class instead of Integer.TYPE (ModelAdapterFactory, line 428ff). Otherwise defaults for numerical types will not work.



--
This message was sent by Atlassian JIRA
(v6.2#6252)