commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: [math] Re: svn commit: r1078734
Date Wed, 09 Mar 2011 15:25:15 GMT
On Wed, Mar 09, 2011 at 03:00:07PM +0100, Luc Maisonobe wrote:
> Le 09/03/2011 13:59, Gilles Sadowski a écrit :
> > Hi.
> > 
> >>>> [...]
> >>>>
> >>>> Or make the fields transient?
> >>>>
> >>>> That would perhaps cause problems if the Exceptions were ever
> >>>> serialised, but can that happen?
> >>>
> >>> Yes, it's a typical JEE scenario and I cannot say how often I cursed Sun
for 
> >>> stuffing an unserializable object into NamingException.setResolvedObject

> >>> within their LDAP implementation ...
> >>>
> >>> Actually the MathRE should contain a writeObject implementation that 
> >>> replaces any non-serializable object in that array with some kind of 
> >>> replacement (e.g. with its String representation). Otherwise the MathRE
will 
> >>> not reach its destination and all the localization was for nothing.
> >>
> >> That's a good idea. We could even do that replacement directly at
> >> construction and never store the Object themselves, regardless of their
> >> status with respect to serialization.
> > 
> > Do you mean storing only the String representation of the arguments?
> > Wouldn't that defeat the purpose of the map feature (which was to allow any
> > kind of objects to be stored and retrieved)?
> 
> You are right, I am stupid. So we have to check for serializable.

I don't see why: The serialization will work provided all "Object" arguments
are "Serializable"; it is the user's code responsibility to not try
serializing the exception when it knows that it contains a non-serializable
object.
If the exceptions generated from CM contain only serializable objects (which
is the case now), then we've done our part.


Best,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message