MASON-INTEREST-L Archives

March 2013

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Proportional Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mime-Version:
1.0
Sender:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Subject:
From:
"Matt L. Miller" <[log in to unmask]>
Date:
Wed, 6 Mar 2013 18:30:45 -0500
Content-Transfer-Encoding:
8bit
Content-Type:
text/plain; charset="ISO-8859-1"
Reply-To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Parts/Attachments:
text/plain (22 lines)
While I was doing some failure-mode testing on some code that uses GeoMASON,
I have noticed that ShapeFileImporter.read(URL, GeomVectorField, Bag, Class)
has a problem with its exception handling.

The method declares that it throws a FileNotFoundException; however, it
actually never does so -- the entire IO section is surrounded in a try ...
catch that catches all IOExceptions and prints an error message, but does
NOT propagate the exception back up to the caller. Thus, you get an error
message on STDERR, but then your code continues blithely along.

I would recommend either adding a

throw e;

(which would require changing the method's throws declaration from
FileNotFoundException to IOError) or even just doing without that enclosing
try...catch (which requires the same change to the method signature).

Thanks for thoughts and input!
Matt L. Miller
UCDavis

ATOM RSS1 RSS2