lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3042) AttributeSource can have an invalid computed state
Date Fri, 22 Apr 2011 20:38:05 GMT


Uwe Schindler commented on LUCENE-3042:

I found the bug, its totally confusing but is a design error in the state caching originated
by Michael Busch:
- Tokenizer and all Filters share the same Map instances for the attributes
- BUT: Tokenizer and every filter have its own cached state
- if you call clearAttributes on the filter, it clears its own state, but not the one of its
parent tokenizer
- if tokenizer calls clearAttributes, nothing is done

Fix is to make the AttributeSourcesnot only share the maps, but also the state

> AttributeSource can have an invalid computed state
> --------------------------------------------------
>                 Key: LUCENE-3042
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Robert Muir
>            Assignee: Uwe Schindler
> If you work a tokenstream, consume it, then reuse it and add an attribute to it, the
computed state is wrong.
> thus for example, clearAttributes() will not actually clear the attribute added.
> So in some situations, addAttribute is not actually clearing the computed state when
it should.

This message is automatically generated by JIRA.
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message