No, this is my mistake. I should have deprecated and added new methods
that returned the Fieldable.
The cast is only going to be safe when using non lazy field loading,
which is the standard before this anyway.
Chris Hostetter wrote:
: Is this intentional?
: If not, uses of "Field" in uni
: Is this intentional?
: If not, uses of "Field" in unit tests should not have been changed to
Fieldable.
If it was intentional, then at a minimum it should be documented as an
API Change (and not just a new feature).
-Hoss
-
Looking at the changes a little more, it looks like the following
Document methods should be reverted:
public final Fieldable[] getFields(String name)
and
public final Fieldable getField(String name)
That should preserve compatibility with older applications.
The only danger is that a cast to
LUCENE-545 that was recently committed breaks backward compatibility with
Document.getField(), a non-expert level API that is *very* widely used.
Something simple like
Field x = mydoc.getField("x");
no longer compiles (and neither do other methods with Field in the signature).
Is this intentio