[ 
https://issues.apache.org/jira/browse/LUCENE-6213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14301938#comment-14301938
 ] 

Uwe Schindler commented on LUCENE-6213:
---------------------------------------

bq. Well, except that would convert the array to a list on each call. I would 
rather keep the current code.

Well, I would declare it as this List. List and array are basically the same in 
Java. Arrays.asList() does only "wrap" not "convert". In addition the 
declaration of the static constant would be much more readable (sorry, I hate 
this "new String[] { ... }" syntax - the code looks like written by a C 
developer - not Java like):

{code:java}
private static final List<String> unsupportedCodecs = Arrays.asList(
  "Lucene3x"
);
{code}

Then you can do the contains().
(because its private, there is no need to make it explicitely "unmodifiable")

Uwe

> Add test for IndexFormatTooOldException if a commit has a 3.x segment
> ---------------------------------------------------------------------
>
>                 Key: LUCENE-6213
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6213
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>            Assignee: Ryan Ernst
>         Attachments: LUCENE-6213.patch, LUCENE-6213.patch, LUCENE-6213.patch, 
> unsupported.4x-with-3x-segments.zip
>
>
> We should add a 4.x index (4.x commit) with some 3.x segment(s) to our 
> backwards tests.
> I don't think we throw IndexFormatTooOldException correctly in this case. I 
> think instead the user will get a confusing SPI error about a missing codec 
> "Lucene3x".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to