[ 
https://issues.apache.org/jira/browse/LUCENE-2310?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Male updated LUCENE-2310:
-------------------------------

    Attachment: LUCENE-2310-Deprecate-DocumentGetFields.patch

Attaching patch for changes to Document implementing above ideas discussed above

- Document#getFields() is deprecated
- Document now implements Iterable<Fieldable> and provides an iterator() method
- Added a getNumFields() method for returning the number of fields in a Document

Having not paid attention earlier, there is already a removeFields method in 
Document, so it didn't need to be added.

There are some greater problems with Document related to this issue.  It 
provides methods for both Fieldables and Fields, getField(String) for example, 
could throw a ClassCastException if used in combination with AbstractField.  
Because the overall goal of this work is to reduce these 3 classes to just 
Field in 4.x, I think we can leave the methods as most will be deprecated.  
However some documentation improvements might prevent any CCEs.

I'll spin off another issue later to do that once this stuff has been committed.

> Reduce Fieldable, AbstractField and Field complexity
> ----------------------------------------------------
>
>                 Key: LUCENE-2310
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2310
>             Project: Lucene - Java
>          Issue Type: Sub-task
>          Components: Index
>            Reporter: Chris Male
>         Attachments: LUCENE-2310-Deprecate-AbstractField-CleanField.patch, 
> LUCENE-2310-Deprecate-AbstractField.patch, 
> LUCENE-2310-Deprecate-AbstractField.patch, 
> LUCENE-2310-Deprecate-AbstractField.patch, 
> LUCENE-2310-Deprecate-DocumentGetFields.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: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to