Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 74094 invoked from network); 24 Jan 2007 00:55:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jan 2007 00:55:11 -0000 Received: (qmail 85731 invoked by uid 500); 24 Jan 2007 00:55:17 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 85670 invoked by uid 500); 24 Jan 2007 00:55:17 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 85648 invoked by uid 99); 24 Jan 2007 00:55:17 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jan 2007 16:55:17 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jan 2007 16:55:10 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 4CBEF1A981A; Tue, 23 Jan 2007 16:54:03 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r499200 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/jvm.java Date: Wed, 24 Jan 2007 00:54:03 -0000 To: derby-commits@db.apache.org From: myrnavl@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070124005403.4CBEF1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: myrnavl Date: Tue Jan 23 16:54:02 2007 New Revision: 499200 URL: http://svn.apache.org/viewvc?view=rev&rev=499200 Log: DERBY-2265 bad code in functionTests.harness.jvm.guessWSHome - prevented StringIndexOutOfBoundsException with j9 Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/jvm.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/jvm.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/jvm.java?view=diff&rev=499200&r1=499199&r2=499200 ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/jvm.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/jvm.java Tue Jan 23 16:54:02 2007 @@ -298,8 +298,17 @@ String sep = System.getProperty("file.separator"); // need to strip off the java directory assuming it's something // like ibm14/jre or ibm14 - wshome = jhome.substring(0,jhome.indexOf(sep + "jre")); - wshome = wshome.substring(0,wshome.lastIndexOf(sep)); + int havejre=jhome.indexOf(sep + "jre"); + if (havejre > 0) + { + wshome = jhome.substring(0,jhome.indexOf(sep + "jre")); + if (wshome.lastIndexOf(sep) >= 0) + wshome = wshome.substring(0,wshome.lastIndexOf(sep)); + } + { + if (jhome.lastIndexOf(sep) >= 0) + wshome = jhome.substring(0,jhome.lastIndexOf(sep)); + } return wshome; }