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

Tilman Hausherr edited comment on PDFBOX-1977 at 3/12/14 5:07 PM:
------------------------------------------------------------------

My mistake (in the encoder) was not to check the bit chunk size after writing 
the last output code and before writing the EOD code. Since the decoder doesn't 
know that an EOD is coming, it had adjusted its own bit chunk size. I fixed 
this and also modified some code per DRY and optimized a bit. Done in rev 
1576820 for the trunk and rev 1576821 for the 1.8 branch.

Any suggestions for the random seed? I'd take System.getCurrentMillis().

Btw, how long did you run your own test with real random until you got this 
fail?


was (Author: tilman):
My mistake (in the encoder) was not to check the bit chunk size after writing 
the last output code and before writing the EOD code. Since the decoder doesn't 
know that an EOD is coming, it had adjusted its own bit chunk size. I fixed 
this and also modified some code per DRY and optimized a bit. Done in rev 
1576820 for the trunk and rev 1576821 for the 1.8 branch.

Any suggestions for the random seed? I'd take System.getCurrentMillis().

Btw, how long did you run your own test until you got this fail?

> LZWFilter fails / TestFilters is non-determinate
> ------------------------------------------------
>
>                 Key: PDFBOX-1977
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1977
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.8.5, 2.0.0
>            Reporter: John Hewson
>            Assignee: Tilman Hausherr
>              Labels: LZW
>             Fix For: 1.8.5, 2.0.0
>
>
> TestFilters uses Random().nextLong() to generate a seed for random data, 
> which means that it is non-determinate. Depending on the seed value, the test 
> may fail or succeed.
> Using the following seed results in the LZW filter failing:
> final long seed = -6257105096642706464L;



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to