From dev-return-39614-apmail-harmony-dev-archive=harmony.apache.org@harmony.apache.org Wed Aug 11 15:19:18 2010 Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 86177 invoked from network); 11 Aug 2010 15:19:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Aug 2010 15:19:18 -0000 Received: (qmail 74833 invoked by uid 500); 11 Aug 2010 15:19:17 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 74762 invoked by uid 500); 11 Aug 2010 15:19:16 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 74753 invoked by uid 99); 11 Aug 2010 15:19:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Aug 2010 15:19:16 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mwessendorf@gmail.com designates 74.125.82.43 as permitted sender) Received: from [74.125.82.43] (HELO mail-ww0-f43.google.com) (74.125.82.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Aug 2010 15:19:10 +0000 Received: by wwb34 with SMTP id 34so224045wwb.0 for ; Wed, 11 Aug 2010 08:18:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; bh=gmunHLWI/EVVM2UVTggsQzp4aqcqk4v855/9R/C2tkc=; b=apyKidDUjggwIQBE4dphsRwITWBckDhW8Z9gxTTWL/kpIaE3V6eiVxaeUbVYLVS3MA USkHGAbdYP86J6Owun1sbWvfDy0/v3YMO8VGPZsSou8kuRpV/6LW5PXivX8hJp/3eoHu +v8r58Sf0/GYYA74UmTBDDzgVZTn8Gkb0pk44= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=YFCz5d7H3X1ivonpuuLv9/+iKpu24N5FZMnstNAvn950TNkZWM5xFB+DpCpFpLpLcu 0MowexALz6m2bO+1XSKcgy5sfyklbVZdpW9Qf6Da5Ckh2XlwLlXa9cXVPIkfgNcM7Mr0 FAeC5uCCf4agWLIMxGDrHj8huuChwHIUXa5vM= MIME-Version: 1.0 Received: by 10.227.146.139 with SMTP id h11mr16699531wbv.197.1281539928963; Wed, 11 Aug 2010 08:18:48 -0700 (PDT) Sender: mwessendorf@gmail.com Received: by 10.227.130.206 with HTTP; Wed, 11 Aug 2010 08:18:48 -0700 (PDT) In-Reply-To: References: <201008101012.o7AACxXK017679@d06av04.portsmouth.uk.ibm.com> Date: Wed, 11 Aug 2010 17:18:48 +0200 X-Google-Sender-Auth: 5yrKT8eCe4qwDhXszUAaalJF80s Message-ID: Subject: Re: [luni] ObjectInputStream.java From: Matthias Wessendorf To: dev@harmony.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org BTW. a bug in this direction was filed against the SUN JDK. the "mapping table" should be exposed, to avoid copy/past development w/in custom ObjectInputStream impls http://bugs.sun.com/view_bug.do?bug_id=3D4942688 -M On Wed, Aug 11, 2010 at 4:46 PM, Jimmy,Jing Lv wrote: > Thanks Matthias, a lesson to me ;) > > 2010/8/11 Matthias Wessendorf > >> a little background. >> >> I am working on an Apache MyFaces project, were we have our own >> ObjectInputStream class ([1]). >> Now when we update to the latest version of one of our dependencies >> (JSF 2.0, Sun Mojarra), we >> got this exception: >> java.lang.ClassNotFoundException: void >> ... >> >> I filed a bug against them, b/c of that (see [2] for more). They said >> the reason why we see it is that with the new version one of their >> helper class stores null values as >> Void.TYPE(s). Therefore they suggested to do what the JDK does. >> >> The did a very simple patch ([3]), which I think is code from the Sun >> JDK 1.6.x of the "standard" ObjectInputStream. >> In order to avoid any license issues, by looking into Sun's JDK, I >> opened Harmony can "borrowed" code. >> >> So I am wondering if the void has been forgotten..., since I suspect >> (as of [3]) that the Sun JDK's ObjectInputStream does >> register void/void.class.... >> >> BTW. I changed our custom ObjectInputStream patch (see [4]) and the >> error (java.lang.ClassNotFoundException: void) is now gone >> >> Greetings, >> Matthias >> >> [1] >> https://issues.apache.org/jira/secure/attachment/12439193/1.2.12.2_compr= essviewstate.patch >> [2] https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=3D1607 >> [3] >> https://javaserverfaces.dev.java.net/nonav/issues/showattachment.cgi/124= 1/1607.txt >> [4] >> https://issues.apache.org/jira/secure/attachment/12451648/TRINIDAD-1747_= August10.patch >> >> >> On Wed, Aug 11, 2010 at 10:21 AM, Jimmy,Jing Lv >> wrote: >> > Hi Matthias, >> > >> > =A0 =A0 I suppose ObjectInputStream is mainly use to serialize Object = but >> void >> > is not a kind of Class to be serialized. Please tell me if I am wrong. >> > >> > 2010/8/10 Mark Hindess >> > >> >> >> >> In message > mail.gmail.com>, >> >> Matthias Wessendorf writes: >> >> > >> >> > Hello, >> >> > >> >> > looking at ObjectInputStream.java, >> >> > >> >> > =A0 =A0 static { >> >> > =A0 =A0 =A0 =A0 PRIMITIVE_CLASSES.put("byte", byte.class); //$NON-N= LS-1$ >> >> > =A0 =A0 =A0 =A0 PRIMITIVE_CLASSES.put("short", short.class); //$NON= -NLS-1$ >> >> > =A0 =A0 =A0 =A0 PRIMITIVE_CLASSES.put("int", int.class); //$NON-NLS= -1$ >> >> > =A0 =A0 =A0 =A0 PRIMITIVE_CLASSES.put("long", long.class); //$NON-N= LS-1$ >> >> > =A0 =A0 =A0 =A0 PRIMITIVE_CLASSES.put("boolean", boolean.class); //= $NON-NLS-1$ >> >> > =A0 =A0 =A0 =A0 PRIMITIVE_CLASSES.put("char", char.class); //$NON-N= LS-1$ >> >> > =A0 =A0 =A0 =A0 PRIMITIVE_CLASSES.put("float", float.class); //$NON= -NLS-1$ >> >> > =A0 =A0 =A0 =A0 PRIMITIVE_CLASSES.put("double", double.class); //$N= ON-NLS-1$ >> >> > =A0 =A0 } >> >> > >> >> > I am wondering why there is no "void", void.class key-value pair? >> >> >> >> I see you've raised a JIRA bug for this. =A0I'm struggling to underst= and >> >> in what context this would be needed. =A0Can you provide a test case = that >> >> shows why it is needed? >> >> >> >> Regards, >> >> =A0Mark. >> >> >> >> >> >> >> > >> > >> > -- >> > >> > Best Regards! >> > >> > Jimmy, Jing Lv >> > >> >> >> >> -- >> Matthias Wessendorf >> >> blog: http://matthiaswessendorf.wordpress.com/ >> sessions: http://www.slideshare.net/mwessendorf >> twitter: http://twitter.com/mwessendorf >> > > > > -- > > Best Regards! > > Jimmy, Jing Lv > China Software Development Lab, IBM > --=20 Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf