[
https://issues.apache.org/jira/browse/LUCENE-5762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Muir updated LUCENE-5762:
--------------------------------
Attachment: LUCENE-5762.patch
Attached is a patch:
Lucene42Norms is made read-only with a read-write version in test-framework.
Lucene45DocValues has a check like this that it does when it goes to write a
field:
{code}
void checkCanWrite(FieldInfo field) {
if ((field.getDocValuesType() == DocValuesType.NUMERIC ||
field.getDocValuesType() == DocValuesType.BINARY) &&
field.getDocValuesGen() != -1) {
// ok
} else {
throw new UnsupportedOperationException("this codec can only be used for
reading");
}
}
{code}
And of course a read-write version in test-framework that just allows anything.
> Disable old codecs as much as possible
> --------------------------------------
>
> Key: LUCENE-5762
> URL: https://issues.apache.org/jira/browse/LUCENE-5762
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
> Attachments: LUCENE-5762.patch
>
>
> Currently, because of updatable docvalues, ancient codecs are not really
> read-only... this is a real problem because we can get confused about
> backwards compatibility or even introduce bugs.
> Its only necessary to make BINARY and NUMERIC work here, we should throw UOE
> every other possible place and prevent use of old codecs to the greatest
> extent possible.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]