uschindler commented on pull request #37:
URL: https://github.com/apache/lucene/pull/37#issuecomment-805119396


   Hi @rmuir, 
   I will dig into the `TermToBytesRefAttribute` issue, but I know why it 
fails. The reason is that TermToBytesRefAttribute is a superinterface of the 
actual `CharTermAttribute`, `BytesRefTermAttribute`,...
   
   When the indexer calls getAttribute(TermToBytesRefAttribute.class) it gets 
back `null`, because the attributeimpl is not aware of it (not declared).
   
   In general, all AttributeImpls should explicitely list all interfaces they 
implement (also for documentation purposes).
   
   P.S.: The issue we have seen here is similar to a private method that is 
referenced by a MethodHandle (which is perfectly valid), but "unused" checker 
cannot see the method is ever called. Therefore we always declare those methods 
as package-private, although private would be more correct. I remmeber this 
from Elastic Painless and Expressions :-)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to