Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 50539 invoked from network); 22 Mar 2005 02:49:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Mar 2005 02:49:54 -0000 Received: (qmail 43897 invoked by uid 500); 22 Mar 2005 02:49:50 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 43140 invoked by uid 500); 22 Mar 2005 02:49:48 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 43127 invoked by uid 99); 22 Mar 2005 02:49:48 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: 192.18.98.36 is neither permitted nor denied by domain of jfarcand@apache.org) Received: from brmea-mail-4.Sun.COM (HELO brmea-mail-4.sun.com) (192.18.98.36) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 21 Mar 2005 18:49:46 -0800 Received: from phys-d3-ha21sca-2 ([129.145.155.165]) by brmea-mail-4.sun.com (8.12.10/8.12.9) with ESMTP id j2M2GrXA004922 for ; Mon, 21 Mar 2005 19:16:53 -0700 (MST) Received: from conversion-daemon.ha21sca-mail1.sfbay.sun.com by ha21sca-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0IDQ00701E9HVU@ha21sca-mail1.sfbay.sun.com> (original mail from jfarcand@apache.org) for tomcat-dev@jakarta.apache.org; Mon, 21 Mar 2005 18:16:49 -0800 (PST) Received: from [192.168.2.37] (vpn-129-147-152-151.Central.Sun.COM [129.147.152.151]) by ha21sca-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTP id <0IDQ007O3EC047@ha21sca-mail1.sfbay.sun.com>; Mon, 21 Mar 2005 18:16:49 -0800 (PST) Date: Mon, 21 Mar 2005 21:16:51 -0500 From: Jeanfrancois Arcand Subject: Re: DO NOT REPLY [Bug 34090] - org.apache.catalina.util.CustomObjectInputStream causes problems In-reply-to: <423EFB0A.5090902@apache.org> To: Remy Maucherat Cc: Tomcat Developers List Message-id: <423F8013.60905@apache.org> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 8BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) References: <200503211640.j2LGef1C027524@ajax.apache.org> <423EFB0A.5090902@apache.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Remy Maucherat wrote: > bugzilla@apache.org wrote: > >> DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� >> RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT >> . >> ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� >> INSERTED IN THE BUG DATABASE. >> >> http://issues.apache.org/bugzilla/show_bug.cgi?id=34090 >> >> ------- Additional Comments From remm@apache.org 2005-03-21 17:40 >> ------- >> Whatever it is you are doing is absolutely scary. I tried to see if >> calling the >> superclass helps and does not cause regressions or problems, as the >> field you >> mention cannot be used. > > > If I commit this, does Sun see it as a legal problem ? Simply calling > the superclass could create issues, and I don't want to try it. Hi, here is the answer I got from management: " Hi Remy - This is Jim. We (Sun) can't relicense use of copywritten Sun code from the JDK outside of the JDK itself without extensive use of lawyers, and the Apache board. So, it would be better to find another solution. This isn't significantly different than JBoss' position that Apache can't use JBoss code, so I'm sure it's not too big a suprise. If I'm misunderstanding what's been requested, please let me know." -- Jeanfrancois > > Index: CustomObjectInputStream.java > =================================================================== > RCS file: > /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/CustomObjectInputStream.java,v > > retrieving revision 1.4 > diff -u -r1.4 CustomObjectInputStream.java > --- CustomObjectInputStream.java 10 Mar 2005 23:54:45 -0000 1.4 > +++ CustomObjectInputStream.java 21 Mar 2005 16:47:25 -0000 > @@ -21,6 +21,7 @@ > import java.io.ObjectInputStream; > import java.io.ObjectStreamClass; > import java.lang.reflect.Proxy; > +import java.util.HashMap; > > /** > * Custom subclass of ObjectInputStream that loads from the > @@ -37,6 +38,23 @@ > > > /** > + * List of primitive classes. > + */ > + private static final HashMap primitiveTypes = new HashMap(); > + static { > + primitiveTypes.put("boolean", boolean.class); > + primitiveTypes.put("byte", byte.class); > + primitiveTypes.put("char", char.class); > + primitiveTypes.put("double", double.class); > + primitiveTypes.put("float", float.class); > + primitiveTypes.put("int", int.class); > + primitiveTypes.put("long", long.class); > + primitiveTypes.put("short", short.class); > + primitiveTypes.put("void", void.class); > + } > + > + > + /** > * The class loader we will use to resolve classes. > */ > private ClassLoader classLoader = null; > @@ -70,7 +88,17 @@ > */ > public Class resolveClass(ObjectStreamClass classDesc) > throws ClassNotFoundException, IOException { > - return Class.forName(classDesc.getName(), false, classLoader); > + try { > + return Class.forName(classDesc.getName(), false, classLoader); > + } catch (ClassNotFoundException e) { > + // Trying again for the case of primitives > + Class result = (Class) > primitiveTypes.get(classDesc.getName()); > + if (result != null) { > + return result; > + } else { > + throw e; > + } > + } > } > > R�my > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org