commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Tripodi <>
Subject Re: [Graph] Possible NPE if user requests a vertex that not exists on BaseGraph class
Date Wed, 15 Feb 2012 19:57:55 GMT

I'd recommend to throw the GraphException, as we reported in the javadoc:

     * <b>NOTE</b>: implementors have to take in consideration
throwing a {@link GraphException}
     * if an error occurs while performing that operation.

How does it sound?
all the best,


On Wed, Feb 15, 2012 at 7:25 PM, Marco Speranza
<> wrote:
> Hi all guys,
> I notice that the methods "getConnectedVertices( V v )" and "getEdge( V
> source, V target )" into the class BaseGraph are not protect if a user
> passes  a vertex that not exists.
> Moreover in the first case the system throws a NPE and in the second case
> the system accepts the argument but return a null value to the user.
> Should it be a good idea put a control and throw a IllegalArgumentEx in
> both cases?
> Ciao
> --
> Marco Speranza <marcosperanza@ <>>
> Google Code:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message