Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 89227 invoked from network); 9 Mar 2011 20:44:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Mar 2011 20:44:11 -0000 Received: (qmail 69136 invoked by uid 500); 9 Mar 2011 20:44:11 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 69046 invoked by uid 500); 9 Mar 2011 20:44:10 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 69038 invoked by uid 99); 9 Mar 2011 20:44:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Mar 2011 20:44:10 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [194.206.126.239] (HELO smtp.nordnet.fr) (194.206.126.239) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Mar 2011 20:44:01 +0000 Received: from lehrin (250.246.146.195.dynamic.adsl.abo.nordnet.fr [195.146.246.250]) by smtp.nordnet.fr (Postfix) with ESMTP id 86851480BA for ; Wed, 9 Mar 2011 21:43:39 +0100 (CET) Received: by lehrin (Postfix, from userid 5001) id 98F074073; Wed, 9 Mar 2011 21:43:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lehrin.spaceroots.local X-Spam-Level: Received: from lehrin.spaceroots.local (lehrin.spaceroots.local [127.0.0.1]) by lehrin (Postfix) with ESMTP id DFED44071 for ; Wed, 9 Mar 2011 21:43:35 +0100 (CET) Message-ID: <4D77E677.1040303@free.fr> Date: Wed, 09 Mar 2011 21:43:35 +0100 From: Luc Maisonobe User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: Commons Developers List Subject: Re: [math] Re: svn commit: r1078734 References: <20110307103754.1331923889EB@eris.apache.org> <4D768EE6.6050707@free.fr> <4D773ED3.1020607@free.fr> <20110309125903.GR22814@dusk.harfang.homelinux.org> <4D7787E7.4070307@free.fr> <20110309152515.GS22814@dusk.harfang.homelinux.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,FREEMAIL_FROM autolearn=unavailable version=3.3.1 Le 09/03/2011 16:55, Jörg Schaible a écrit : > Hi Gilles, > > Gilles Sadowski wrote: > >> 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. > > Yes, but it might not be always directly obvious. It's always annoying, if > in a client/server scenario an error occurs and suddenly cannot even > reported to the client. That's why I proposed the customized > writeObject/readObject for MathRE. The thrown exception should make it under > any circumstances over the wire, even if it means that unserializable > objects are nulled or replaced with a String representation. Otherwise the > client simply gets an error and no-one can tell why. However, this is an > action only for the serialization process. Or ensure - as already proposed > in this thread - that only serializable types can be added by using an > appropriate method/type signature. Since in this case a complete roundtrip serialization/deserialization occurs, I think we should convert to null non-serializable objects at the serialization step as you propose. Luc > > - Jörg > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org