lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Male (JIRA)" <>
Subject [jira] Commented: (LUCENE-2310) Reduce Fieldable, AbstractField and Field complexity
Date Sun, 14 Mar 2010 18:37:27 GMT


Chris Male commented on LUCENE-2310:

Spent more time pondering how to deprecate Fieldable and the major issue is Document#getFields(),
which returns a modifiable List<Fieldable>.  Because it is modifiable, consumers can
add to it directly rather than through Document.

If it were unmodifiable, then it would be possible to control adding Fieldables in Document,
which would then allow us to wrap Fieldable instances in a Field subclass, meaning Document
would only have a List<Field>.

Given this limitation, I'm currently thinking about not trying to deprecate Fieldable in 3.x,
but instead adding the unmodifiable list method and deprecating #getFields().  I would also
add some functionality for removing Fieldables, which seems to be all thats lack in Document.
 Then in 4.x I would deprecate Fieldable.

Slow process, but I think by deprecating AbstractField now we have already made a step forward
to improving this hierarchy in preparation for the FieldType classes.

Remaining in this work is a code cleanup of all 3 classes, so that code is understandable
when we add in FieldType.

> Reduce Fieldable, AbstractField and Field complexity
> ----------------------------------------------------
>                 Key: LUCENE-2310
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Sub-task
>          Components: Index
>            Reporter: Chris Male
>         Attachments: LUCENE-2310-Deprecate-AbstractField.patch, LUCENE-2310-Deprecate-AbstractField.patch,
> In order to move field type like functionality into its own class, we really need to
try to tackle the hierarchy of Fieldable, AbstractField and Field.  Currently AbstractField
depends on Field, and does not provide much more functionality that storing fields, most of
which are being moved over to FieldType.  Therefore it seems ideal to try to deprecate AbstractField
(and possible Fieldable), moving much of the functionality into Field and FieldType.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message