[ https://issues.apache.org/jira/browse/SLING-3547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14032191#comment-14032191 ]
ASF GitHub Bot commented on SLING-3547: --------------------------------------- Github user kwin closed the pull request at: https://github.com/apache/sling/pull/16 > 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, Sling Models > Implementation 1.0.4 > Reporter: Konrad Windszus > Assignee: Justin Edelson > Fix For: Sling Models Implementation 1.0.6 > > > 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)