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

Shai Erera commented on LUCENE-4440:
------------------------------------

bq. I agree we should add a null check in SPILoader's lookup method (not 
Codec.forName) to throw IllegalStateException("Cannot requests codec until 
service provider interface has finished loading them").

This won't help. The NPE is thrown from Codec.forName *because* {{loader}} is 
null ! It confused me, since I thought static members should be initialized 
before any method is accessed, but perhaps this doesn't hold for static methods?

bq. From the documentation perspective, the problem is not really FIlterCodec's 
problem. Its more general really.

Yes, that's why I suggested to add this comment to Codec.forName(). Oh, unless 
you mean that we should add that comment not as part of this issue?
                
> FilterCodec should take a delegate Codec in its ctor
> ----------------------------------------------------
>
>                 Key: LUCENE-4440
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4440
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/codecs
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>            Priority: Minor
>         Attachments: LUCENE-4440.patch
>
>
> FilterCodec has a delegate() method through which an extension can return its 
> delegate Codec. This method is called on every Codec method. Adrien, on 
> LUCENE-4391, failed to pass a Codec in the ctor, since he couldn't called 
> Codec.forName().
> Instead, we should just pass e.g. new Lucene40Codec(). I'll post a patch 
> shortly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to