You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/03/23 18:10:27 UTC

[GitHub] [lucene] uschindler commented on pull request #37: LUCENE-9856: static analysis take two

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org