[
https://issues.apache.org/jira/browse/SLING-4056?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14179975#comment-14179975
]
ASF GitHub Bot commented on SLING-4056:
---------------------------------------
GitHub user kwin opened a pull request:
https://github.com/apache/sling/pull/32
SLING-4056, support adapters on Sling Model Factory
also additional test cases for the factory were provided
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/kwin/sling
SLING-4056-supportadapterswithmodelfactory
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/sling/pull/32.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #32
----
commit dec684db59ea41b9ea98d2b5dcb295b3aefc1016
Author: Konrad Windszus <[email protected]>
Date: 2014-10-22T14:43:57Z
SLING-4056, support adapters on Sling Model Factory, add test cases for
the factory
----
> 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)