Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null in merge result of an empty node set #11

Closed
vvvy opened this issue Sep 10, 2013 · 1 comment
Closed

null in merge result of an empty node set #11

vvvy opened this issue Sep 10, 2013 · 1 comment

Comments

@vvvy
Copy link

vvvy commented Sep 10, 2013

If a new set is created by ++ of an empty result of diSuccessors (in first place) and of some other non-emplty node set, the new set erroneously contains null in place of the empty set.

Consider the following code snippet:

import scalax.collection.Graph
import scalax.collection.GraphPredef._, scalax.collection.GraphEdge._
import scalax.collection.edge._

val g = Graph(1 ~> 2, 2 ~> 3)
((g get 3) diSuccessors) ++ ((g get 1) diSuccessors) //ORDER MATTERS!

The last expession yields to Set(null, 2) rather than Set(2).

I used graph-core_2.9.2-1.6.2.jar from Maven with Scala 2.9.3.

peter-empen pushed a commit that referenced this issue Sep 11, 2013
@peter-empen
Copy link
Contributor

Thanks for reporting! 9525531 resolves this issue that will be included in the next release. Until then you may build the executable on your own via SBT or work around it by either using ++= or calling toSet like

((g get 3) diSuccessors).toSet ++ ((g get 1) diSuccessors)

Peter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants