[
https://issues.apache.org/jira/browse/OPENNLP-722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14177920#comment-14177920
]
Vinh Khuc commented on OPENNLP-722:
-----------------------------------
> Was there a change? I googled that and coundn't find a reference.
Sorry, it's just my guess. I couldn't google it either.
Instead, I found a link about changes in Java 8's collections:
http://docs.oracle.com/javase/8/docs/technotes/guides/collections/changes8.html
"In rare situations, this change could introduce a change to the iteration
order of HashMap and HashSet. A particular iteration order is not specified for
HashMap objects - any code that depends on iteration order should be fixed."
That may explain why the ordering of elements in predicateSet is changed in
Java 8. As you have mentioned above, the ordering matters in the computation.
As a reference, I've created a small code to demonstrate it:
https://gist.github.com/vinhkhuc/0b65b9e493fd07475f45.
Sum of the same float numbers in different orders gives different results. The
difference is smaller for double numbers. The following link explains this
issue quite well: http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
> PerceptronPrepAttachTest fails only on Java 8
> ---------------------------------------------
>
> Key: OPENNLP-722
> URL: https://issues.apache.org/jira/browse/OPENNLP-722
> Project: OpenNLP
> Issue Type: Bug
> Components: Build, Packaging and Test
> Affects Versions: 1.6.0
> Reporter: Joern Kottmann
> Assignee: Joern Kottmann
> Priority: Minor
> Fix For: 1.6.0
>
>
> The test
> PerceptronPrepAttachTest.testPerceptronOnPrepAttachDataWithStepSizeDecrease
> fails if executed on Java 8.
> It would be really nice to track down the cause of that.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)