Re: Sling models - Resource decorator

2017-06-12 Thread Justin Edelson
Hi Roy, This sounds like unexpected behavior. Please create a JIRA for this, ideally with a test case, if you have not already. Thanks, Justin On Mon, Jun 12, 2017 at 4:38 AM Roy Teeuwen wrote: > Hey Jason, Guys, > > No one can give me an answer if this is a bug or something

Re: Sling models - Resource decorator

2017-06-12 Thread Justin Edelson
FWIW, I committed an integration test at http://svn.apache.org/viewvc?view=revision=1798489 checking that the wrapped resource is injected via the @Self annotation. Would be interesting to see how this differs from what you are doing. Regards, Justin On Mon, Jun 12, 2017 at 12:23 PM Justin

Re: Sling models - Resource decorator

2017-06-12 Thread Roy Teeuwen
Hey Justin, The reason why it is odd to me is that it should be agnostic to being wrapped or not. You use the resourceresolver to get the resource and then do an adapt, all not knowing anything about being wrapped or not, seeing as the resource resolver also does the wrapping internally, why

Re: Sling models - Resource decorator

2017-06-12 Thread Roy Teeuwen
Hey Justin, Cool, thanks for the integration test! Just change the modelFactory.createModel to resource.adaptTo(SelfModel.class) and you will see that the test fails :) Greets, Roy > On 12 Jun 2017, at 18:52, Justin Edelson wrote: > > FWIW, I committed an integration

Re: Sling models - Resource decorator

2017-06-12 Thread Roy Teeuwen
Hey Justin, Aha ok I get what you are saying. Then the problem indeed lies with the ResourceWrapper for not using the AdapterFactory. Thanks! I guess I can change this in my own code to override the method in my resource wrapper, although it still feels like something I wouldn't expect,

Re: Sling models - Resource decorator

2017-06-12 Thread Roy Teeuwen
Hey Jason, Guys, No one can give me an answer if this is a bug or something wanted? I can always register a Jira ticket for and put it on the dev list of course Greets, Roy > On 6 Jun 2017, at 21:50, Roy Teeuwen wrote: > > Hey Jason, > > No to both assumptions > > - I used