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

David Smiley edited comment on LUCENE-8292 at 5/7/18 12:55 PM:
---------------------------------------------------------------

Maybe it would be helpful if we simply add a _comment_ to FilterTermsEnum of 
the methods it does not override but could still be by subclasses that wish to? 
 e.g.:

{code:java}
//inherited methods with default impls that could still be overridden:
// public AttributeSource attributes()
// public boolean seekExact(BytesRef text) throws IOException
// public void seekExact(BytesRef term, TermState state) throws IOException
// public TermState termState() throws IOException
{code}

The main down-side is that it could be easy to forget to maintain this comment 
as changes happen over time.  WDYT [~jpountz]?


was (Author: dsmiley):
Maybe it would be helpful if we simply add a _commented_ to FilterTermsEnum of 
the methods it does not override but could still be by subclasses that wish to? 
 e.g.:

{code:java}
//inherited methods with default impls that could still be overridden:
// public AttributeSource attributes()
// public boolean seekExact(BytesRef text) throws IOException
// public void seekExact(BytesRef term, TermState state) throws IOException
// public TermState termState() throws IOException
{code}

The main down-side is that it could be easy to forget to maintain this comment 
as changes happen over time.  WDYT [~jpountz]?

> Fix FilterLeafReader.FilterTermsEnum to delegate all seekExact methods
> ----------------------------------------------------------------------
>
>                 Key: LUCENE-8292
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8292
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>    Affects Versions: 7.2.1
>            Reporter: Bruno Roustant
>            Priority: Major
>             Fix For: trunk
>
>         Attachments: 
> 0001-Fix-FilterLeafReader.FilterTermsEnum-to-delegate-see.patch, 
> LUCENE-8292.patch
>
>
> FilterLeafReader#FilterTermsEnum wraps another TermsEnum and delegates many 
> methods.
> It misses some seekExact() methods, thus it is not possible to the delegate 
> to override these methods to have specific behavior (unlike the TermsEnum API 
> which allows that).
> The fix is straightforward: simply override these seekExact() methods and 
> delegate.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to