Just reading up on this and have the basic question: what is the motivation for 
passing through the exceptions?

>From what I can see it is simply that the exceptions become visible to the 
>developer, which can be done by properly logging them (in the adapterfactories 
>etc.). It was mentioned that this decision (whether to log or not) depends on 
>the application = user of the adaptTo call. But I haven't seen an example of 
>that and are unsure that really is the case.

The example Stefan gave [1] is just about removing the boilerplate of the null 
check + throwing a runtime exception, which could be handled using a static 
utility method (adaptOrThrow, but outside the adaptable interface). Also, this 
seems to be heavily depending on the style of the application code, whether 
exceptions are used a lot or null handling (using optionals etc.) is prefered 
and done consistently. Hence I am not sure if that requires a major change in 
the adaptable interface contract.

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

Cheers,
Alex

Reply via email to