--- [EMAIL PROTECTED] wrote:
> On Wed, 21 Mar 2001, Mel Martinez wrote:
> 
> > StringManager's getString() currently deals with
> the
> > MissingResourceException by simply returning a
> String
> > consisting of a warning message about not being
> able
> > to find the particular key.  I don't think that is
> > correct behavior.  I think it should throw the
> > MissingResourceException or return null and that
> > calling code should deal with it.  Otherwise the
> 
> Ignoring exceptions is bad. Having to handle
> exceptions
> for trivial cases is bad too.
> 

I think that in this case, the pattern is so similar
to a Collections retrieval that it makes sense to use
'null' as the return value in the event the String
resource is not found rather than an exception.  This
should have the least impact on existing client code
and is consistent with most other java usage of
containers.

The gain is that it will now at least be _possible_
for the client code to detect that a String was not
found (by simply checking for null).  If the code does
not do this check, in most cases all that would happen
is that "null" would be displayed.  In rare cases, a
nullpointerexception may be thrown (if they try to
invoke a String method without first checking for
null).  We'll have to track those down as they occur.

> My feeling is that this is not the biggest priority,
> but you are right - StringManager and the whole
> resource
> handling needs a refactoring. Go for it, if you want
> to do it - I'll do whatever I can to help.
> 
> ( I think thread pools or jasper or the admin are in
> a much
>  bigger need for fixes and cleanup )
> 

I'll be starting to tackle tc3.3 Jasper refactoring
this week with a proposal and hopefully some
discussion.  Next week I'll have serveral days where I
can devote quite a bit of time to implementing it.


> I am hoping the "commons" will ease our work - this
> is 
> one of the things that are used in all jakarta
> projects,
> and it would be a good thing to share it ( in which
> case
> refactoring it and merging with the best out of what
> other 
> projects are doing  is worth the effort ) 
> 

I'm only going to put this one tweak in the
StringManager.getString() and start to refactor jasper
to use StringManager for now.  I'll also look at
putting in a short-term fix for the standalone jasper
classpath problem mentioned in another thread.  Small
steps.

mel


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

Reply via email to