Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 43162 invoked from network); 3 Feb 2003 15:56:15 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 3 Feb 2003 15:56:15 -0000 Received: (qmail 17831 invoked by uid 97); 3 Feb 2003 15:57:44 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@nagoya.betaversion.org Received: (qmail 17824 invoked from network); 3 Feb 2003 15:57:43 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 3 Feb 2003 15:57:43 -0000 Received: (qmail 42252 invoked by uid 500); 3 Feb 2003 15:56:00 -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 42240 invoked from network); 3 Feb 2003 15:56:00 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 3 Feb 2003 15:56:00 -0000 Received: (qmail 88354 invoked from network); 3 Feb 2003 15:55:59 -0000 Received: from unknown (HELO apache.org) (127.0.0.1) by localhost.apache.org with SMTP; 3 Feb 2003 15:55:59 -0000 Message-ID: <3E3E9111.1010908@apache.org> Date: Mon, 03 Feb 2003 16:56:01 +0100 From: Remy Maucherat Organization: ASF User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3b) Gecko/20030114 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Developers List Subject: Re: [PATCH] allow tomcat5 to compile/run with JDK1.3 References: <3E3DBEFF.6090405@joedog.org> <3E3E2B82.50906@apache.org> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: localhost.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Costin Manolache wrote: > Remy Maucherat wrote: > > >>Tim Funk wrote: >> >>>Tomcat5 does not compile with JDK1.3. It does with JDK1.4. >>> >>>There is only one line of code that prevents it from compiling with >>>JDK1.3. org.apache.catalina.loader.WebappClassLoader depends on >>>File.toURI() which does not exist on jdk1.3. >>> >>>I got around this by the performing the following: >>>OLD CODE: >>> return realFile.toURI().toURL(); >>>NEW CODE >>> return new URL("file:" + realFile.toURL().getPath()); >>> >>>My patch also has some spurious stuff because my text editor >>>automatically strips all trailing whitespace from lines and converts >>>tabs to spaces. The important stuff is the last 9 lines of the patch >>>file. >> >>The patch is a bad idea. The change was made to fix RMI related problems. >> >>What should be done is invoke the appropriate methods through >>reflection, catching any error (and defaulting to the old code if it >>fails). > > > Well, reflection is a bad idea too :-) A better solution is to use a > wrapper like jdkCompat ( i.e. a base class with the 1.3 implementation, > extended with a 1.4 impl ). This class could include other 1.4 methods > and their 1.3 equivalent, if any. Well, I was planning to implement it as: try { // do the nasty 1.4 stuff with reflection } catch (Throwable t) { // do the compatible stuff } It's not nice but it works (and as the CL is cached, we don't care too much about the performance loss due to the exception). > This would allow implementing the correct stuff, instead of failing. Sure. Remy --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org