Hi I'm not sure if it is a good idea that a ResourceDecorator could return null. IMHO it's not what someone would expect from a Decorator. All the more that "decorator" is the name of a well known pattern, which would never be a null object (only a null object could be decorated but not vice versa).
best regards mike > -----Original Message----- > From: Bertrand Delacretaz [mailto:bdelacre...@apache.org] > Sent: Friday, December 06, 2013 11:49 AM > To: dev > Subject: Re: [OT] Feature flag influence on Resource access (Was: FYI: feature > flags prototype) > > Hi, > > On Fri, Nov 15, 2013 at 8:40 AM, Felix Meschberger <fmesc...@adobe.com> > wrote: > > So, finally, I agree that baking the feature flag support directly into the > ResourceResolver > > implementation is suboptimal, it is probably still the most comprehensive > > and > complete > > solution to the requirements... > > I had another look at this, and the existing ResourceDecorator already > plays a similar role as an extension point to "do something" to each > Resource while it's being resolved. That's already baked in the > resource resolver, so we can leverage it without requiring much code > changes. > > ResourceDecorator.decorate(Resource r) returning null is currently > only vaguely specified and certainly not used, as that causes NPEs in > places - I think we just need to clarify that decorate returning null > causes a Resource to be ignored, fix the code so that it's true and > we're good. > > I have created SLING-3267 to track that, I'll create a patch for review there. > > -Bertrand