[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: null objects don't yell; JAVASWARMGDB
From: |
Joshua Madden |
Subject: |
Re: null objects don't yell; JAVASWARMGDB |
Date: |
Mon, 8 Jan 2001 14:14:40 -0800 (Pacific Standard Time) |
On Mon, 8 Jan 2001, Paul E Johnson wrote:
> Suppose model swarm loops over agents, telling them what to do. Suppose
> there is some mistake inside the method the agent is carrying out, so
> that it tries to send a message to a null object. Java makes no error
> message, but instead it terminates the action for the whole loop right
> at that spot.
My experience with Java is relatively limited, but if it encounters a
null reference unexpectedly, it should throw a NullPointerException and
exit (unless you catch the exception).
You might try the following experiment to confirm that it is indeed a NPE
that is being thrown that causes your code to terminate: enclose the
suspect code in a try-catch block as follows:
try { // code which appears to terminate due to unexpected null reference}
catch (NullPointerException e)
{ //print something out which confirms that you caught this exception}
No idea about the JavaSwarmGDB, never used it.
Joshua Madden
address@hidden Per Obscurius...cs.uoregon.edu/~jmadden
Joshua Madden: Information Scientist, Musician, Philosopher-At-Tall
It's that moment of dawning comprehension that I live for--Bill Watterson
My opinions are too rational and insightful to be those of any organization.
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.