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

[jira] [Comment Edited] (SLING-4056) ModelFactory.canCreateFromAdaptable reports false errors when using "adapters" on models

    [ https://issues.apache.org/jira/browse/SLING-4056?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14178589#comment-14178589 ] 

Konrad Windszus edited comment on SLING-4056 at 10/21/14 4:25 PM:
------------------------------------------------------------------

I'm gonna take a look at this. I am just wondering why the SimplePropertyModel does not have a model annotation at all. Even if you are using alternate adapter classes (http://sling.apache.org/documentation/bundles/models.html#specifying-an-alternate-adapter-class-since-sling-models-110) that is mandatory.


was (Author: kwin):
I'm gonna take a look at this. I am just wondering why the {{{SimplePropertyModel}}} does not have a model annotation at all. Even if you are using alternate adapter classes (http://sling.apache.org/documentation/bundles/models.html#specifying-an-alternate-adapter-class-since-sling-models-110) that is mandatory.

> ModelFactory.canCreateFromAdaptable reports false errors when using "adapters" on models
> ----------------------------------------------------------------------------------------
>
>                 Key: SLING-4056
>                 URL: https://issues.apache.org/jira/browse/SLING-4056
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Sling Models Impl 1.2.0
>            Reporter: Stefan Seifert
>            Priority: Critical
>              Labels: models
>             Fix For: Sling Models Impl 1.2.0
>
>         Attachments: ImplementsExtendsTest.patch
>
>
> SLING-3709 introduced a new "ModelFactory" with methods for checking if adaption is possible and adapt to a model with enhanced exception support.
> the current implementation does not support the "adapters" variant of models, where the model is adapted to an alternate adapter class (see [documentation|http://sling.apache.org/documentation/bundles/models.html#specifying-an-alternate-adapter-class-since-sling-models-110]).
> adaption of such models via adaptTo still works, but false errors are reported
> {noformat}
> ERROR org.apache.sling.models.impl.ModelAdapterFactory - Provided Adapter class does not have a Model annotation
> {noformat}
> if using the factory method ModelFactory.canCreateFromAdaptable an exception is thrown - this is wrong.
> attached is a patch that extends the unit test to include calls to canCreateFromAdaptable - all fail [^ImplementsExtendsTest.patch]
> [~kwin]: can you have a look?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)