swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: null objects don't yell; JAVASWARMGDB


From: Paul E Johnson
Subject: Re: null objects don't yell; JAVASWARMGDB
Date: Mon, 08 Jan 2001 16:33:56 -0600

Ah, interesting. I did as you suggested:
        
 
        try  {
        System.out.println("Renewal is from recruiter " +
renewalRecord.getRecruiter().getGrpNumber() );
        } 
        catch ( NullPointerException e){
        System.out.println ("Theres a null pointer exception, buddy");
        }    

And the system output shows lots of thrown exceptions, but it goes on
processing the list after each. If I don't throw the error, then the
loop just quits.  THanks for the information.

pj

Joshua Madden wrote:
> 
> 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.

-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700

                  ==================================
   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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]