[
https://issues.apache.org/jira/browse/SLING-12578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stefan Seifert closed SLING-12578.
----------------------------------
> Sling Models Impl: Fix Injector and Implementation Picker service ranking
> order again
> -------------------------------------------------------------------------------------
>
> Key: SLING-12578
> URL: https://issues.apache.org/jira/browse/SLING-12578
> Project: Sling
> Issue Type: Bug
> Components: Sling Models
> Affects Versions: Models Implementation 1.7.4, Models Implementation 1.7.6
> Reporter: Stefan Seifert
> Assignee: Stefan Seifert
> Priority: Critical
> Fix For: Models Implementation 1.7.8
>
>
> in SLING-12472 i fixed an service ranking order problem for handling Injector
> and Implementation Picker rankings introduced by SLING-12374. but this was
> based on a false assumption, and the fix actually introduced the bug and did
> not fix it.
> background:
> * for historical reasons, Sling Models interprets the service ranking for
> Injector and ImplementaitonPickers "the wrong way", ranking lower service
> ranking as higher priority when looking for the best matching service
> implementation. we can never change this behavior without breaking lots
> existing code.
> * in SLING-12374 with models impl 1.7.2 the code was modernized getting rid
> of the custom "RankedServices" implementation in favor of DS-based collection
> injection
> * i realized that unit tests that depending on the correct ordering of
> implementation pickers started to fail once updating to models impl 1.7.2,
> identified the code changes from SLING-12374 as the root cause, and
> implemented the bug fix in SLING-12472 and released it as models impl 1.7.4 -
> unit tests are all green again.
> * however, the impression that SLING-12374 broke the logic was wrong, and i
> was fooled by a bug in osgi-mock, which did not preserve the DS-based
> injection list order correctly if new services are registered after the
> service holding the list of references. this bug in osgi-mock was fixed in
> SLING-12413, and released as osgi-mock 3.5.2.
> * once updating the affected to osgi-mock the unit tests depending on
> implementation picker order started to fail again!
> so, this ticket actually reverts all implementation changes from the wrong
> bugfix SLING-12472, but keeps the added more fine-grained unit tests from it
> which check the correct order handling of Injector and ImplementationPickers
> in detail. additionally, we update to latest osgi-mock version to test the
> correct service list order.
> (sorry for the confusion with SLING-12472)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)