[ 
https://issues.apache.org/jira/browse/OAK-6873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16222034#comment-16222034
 ] 

Chetan Mehrotra commented on OAK-6873:
--------------------------------------

bq. However, it's a bit weird that the getter (getIndexProvider) checks if the 
setter is called first... I wouldn't expect that a getter throws an exception. 
Sure, it's a private getter (right now), but still weird.

That is done to ensure that QueryIndexProviderAware contract is respected 
otherwise it would lead to NPE later. With this check it is ensured that 
initializer is called in proper way. We can move the check to caller also

> UserInitializer should not use hard coded QueryIndexProvider
> ------------------------------------------------------------
>
>                 Key: OAK-6873
>                 URL: https://issues.apache.org/jira/browse/OAK-6873
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: security
>            Reporter: Chetan Mehrotra
>            Priority: Minor
>             Fix For: 1.8
>
>         Attachments: OAK-6873-v1.patch
>
>
> [UserInitializer|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java#L99]
>  uses specific QueryIndexProvider
> {noformat}
>         Root root = RootFactory.createSystemRoot(store, EmptyHook.INSTANCE, 
> workspaceName,
>                 securityProvider,
> new CompositeQueryIndexProvider(new PropertyIndexProvider(), new 
> NodeTypeIndexProvider()));
> {noformat}
> Due to this its not possible to use other implementation of 
> QueryIndexProvider like Lucene. To allow using other index types it should 
> instead use {{WhiteboardIndexProvider}}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to