wolfe-pack / wolfe

Wolfe Language and Engine
https://wolfe-pack.github.io/wolfe
Apache License 2.0
135 stars 17 forks source link

EdgeOrdering violates Comparable contract #63

Closed rockt closed 10 years ago

rockt commented 10 years ago

I get the following exception during MaxProduct

Exception in thread "main" java.lang.IllegalArgumentException: Comparison method violates its general contract!
    at java.util.TimSort.mergeLo(TimSort.java:747)
    at java.util.TimSort.mergeAt(TimSort.java:483)
    at java.util.TimSort.mergeCollapse(TimSort.java:410)
    at java.util.TimSort.sort(TimSort.java:214)
    at java.util.TimSort.sort(TimSort.java:173)
    at java.util.Arrays.sort(Arrays.java:659)
    at scala.collection.SeqLike$class.sorted(SeqLike.scala:615)
    at scala.collection.AbstractSeq.sorted(Seq.scala:40)
    at ml.wolfe.MaxProduct$.apply(MaxProduct.scala:22)

Seems as if EdgeOrdering violates the contract of Java's Comparable interface.

rockt commented 10 years ago

Fixed by @riedelcastro via 118465181bc9b32da4420ab96d7c0eea55be0d97