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

Robert Muir updated LUCENE-4212:
--------------------------------

    Attachment: LUCENE-4212.patch

Another buggy case in the MockRandomPostingsFormat: today we do sometimes use 
the no-arg ctor at write time
(should only be used for read!), specifically if you use 
-Dtests.postingsformat=MockRandom

This results in unseeded behavior, not good. With the previous patch you get 
NPE (a little confusing)

Updated patch throws IAE in this case, and I fixed LuceneTestCase to pass the 
seed to MockRandom if you use this -D option.

                
> Tests should not use new Random() without args
> ----------------------------------------------
>
>                 Key: LUCENE-4212
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4212
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: general/build
>            Reporter: Robert Muir
>         Attachments: LUCENE-4212.patch, LUCENE-4212.patch, LUCENE-4212.patch
>
>
> They should be using random() etc, and if they create one, it should pass in 
> a seed.
> Otherwise, they probably won't reproduce.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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]

Reply via email to