Re: finally block does not complete normally - Eclipse
- From: "Erik Frohne" <erik.frohne@xxxxxxxxxxxxx>
- Date: Tue, 31 May 2005 22:54:46 +0200
"JaMess" <JaMess@xxxxxxxxx> wrote in
news:1117570533.9c81424faa7c755ad6ba49b3a5932f58@xxxxxxxxxxx
> Anyway, I would write it like this:
>
> /**
> * Property getter for destination type
> * @return type
> */
> public String getDestinationType() {
> String destType = null;
> try {
> destType = this.getReceiving().getDestinationType();
> }catch (Exception e){}
> if(destType == null || destType.length() == 0) {
> destType = "SCHOOL_DISTRICT";
> }
> return destType;
> }
A general exception thrown has usually a reason behind it.
At least you should do something to inform the user, that
something bad did just happen. The snippet
catch( Exception e ) {
e.printStackTrace();
}
is the minimum I would do here. Anyway, if the called code
could throw a specific (and thus a wanted) exception (such
as IOException) I would try to catch it.
Just my 2 cents.
Erik.
.
- References:
- finally block does not complete normally - Eclipse
- From: dannyDog
- Re: finally block does not complete normally - Eclipse
- From: JaMess
- finally block does not complete normally - Eclipse
- Prev by Date: Re: JUNIT very slow.......
- Next by Date: Which design choice is better?
- Previous by thread: Re: finally block does not complete normally - Eclipse
- Next by thread: Help: Tomcat crashes on java.lang.OutOfMemoryError
- Index(es):