Type safety in Field.setValue() methods
---------------------------------------
Key: LUCENE-3300
URL: https://issues.apache.org/jira/browse/LUCENE-3300
Project: Lucene - Java
Issue Type: Improvement
Reporter: Nikola Tankovic
Priority: Minor
Fix For: Field Type branch
setValue methods in Field and subclasses should introduce type safety, beacuse
what is now possible is to instantiate a BinaryField and set a non-binary
value, but introduce it in such way to be able to preserve the ability to yield
setValue(string) on parent Field class, e.g.:
{code}
Field b = new BinaryField();
b.setValue( ..byte[] value.. );
{code}
One idea is to use generics:
{code}
Field<String> s = new StringField();
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]