[
https://issues.apache.org/jira/browse/SLING-3427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13917940#comment-13917940
]
Carsten Ziegeler commented on SLING-3427:
-----------------------------------------
With your patch, the list keeps the service objects in the list. it is correct,
that the same service is not bound twice, so adding is not a problem. Removing
is the problematic part, if one implementation e.g. always returns "true" for
the equals(Object) method, removing any service object from the list, might
result in removing this one leaving. (Returning "true" is just the simplest
case of messing up the equals() method)
I ran into similar issues while developing similar code in other areas and came
to the conclusion that relying on equals being implemented 100% correctly in
all services can cause trouble
> Incorrect handling of NamespaceMapper bindings within
> SlingServerRepositoryManager
> ----------------------------------------------------------------------------------
>
> Key: SLING-3427
> URL: https://issues.apache.org/jira/browse/SLING-3427
> Project: Sling
> Issue Type: Bug
> Components: JCR
> Affects Versions: JCR Jackrabbit Server 2.1.2
> Reporter: Stefan Scheidewig
> Assignee: Carsten Ziegeler
> Priority: Minor
> Labels: jackrabbit, namespace
> Fix For: JCR Jackrabbit Server 2.1.2
>
> Attachments: namespacemapper_binding_fix.patch
>
>
> The bind method for the namespace service references within class
> org.apache.sling.jcr.jackrabbit.server.impl.SlingServerRepositoryManager is
> accessing the ComponentContext set by the activate method but unfortunately
> that is incorrect because the Declarative Services Specification Version 1.1
> - section 112.5.6 states that the binding happens before the activation. So
> the attempt to bind the TestNamespaceMapper Service to the
> SlingServerRepositoryManager always results in a NullPointerException.
--
This message was sent by Atlassian JIRA
(v6.2#6252)