[jgrapht-developers] interface breaking changes
Brought to you by:
barak_naveh,
perfecthash
From: Barak N. <bar...@us...> - 2006-05-08 13:15:53
|
Since 0.7.0 will anyway involves some interface-breaking changes, it = might be a good chance to consider fixing a few flaws were left lurking in = Graph -- probably due my fault... 1. Edge factory ---------------------------- The inclusion of the edge factory was a pre-Java 5.0 attempt to provide = some crude type-safety for edges. Now after generics have been applied, = there seem to be no strong need for the edge factory. The Graph interface can = be simplified by eliminating the edge factory. Consequently, addEdge(V,V) = will become obsolete and could be eliminate as well. 2. NullPointerException -> IllegalArgumentException --------------------------------------------------- Some methods throw new NullPointerException. It might be better if they throw new IllegalArgumentException to avoid confusion with the NullPointerExceptions that the virtual machine may throw. See http://pmd.sf.net/rules/strictexception.html for more on that. 3. edgesOf(V v) ------------- Contract clarification: what if v is null? What if v doesn't exist in = the graph? Probably should through IllegalArgumentException. Barak=20 |