Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 41974 invoked from network); 9 Nov 2004 22:11:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Nov 2004 22:11:10 -0000 Received: (qmail 84276 invoked by uid 500); 9 Nov 2004 22:10:40 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 84152 invoked by uid 500); 9 Nov 2004 22:10:38 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 84124 invoked by uid 99); 9 Nov 2004 22:10:38 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=NO_REAL_NAME,UPPERCASE_25_50 X-Spam-Check-By: apache.org Received: from [192.18.33.10] (HELO exchange.sun.com) (192.18.33.10) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 09 Nov 2004 14:10:37 -0800 Received: (qmail 25917 invoked by uid 50); 9 Nov 2004 22:10:35 -0000 Date: 9 Nov 2004 22:10:35 -0000 Message-ID: <20041109221035.25916.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: commons-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 32133] - SystemUtils fails init on HP-UX X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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=32133 SystemUtils fails init on HP-UX ------- Additional Comments From gritmaj@wyeth.com 2004-11-09 22:10 ------- I changed the following three methods to fix the issue: private static float getJavaVersionAsFloat() { if (JAVA_VERSION == null) { return 0f; } String trimmedVersion = trimJavaVersion(); String str = trimmedVersion.substring(0, 3); if (trimmedVersion.length() >= 5) { str = str + trimmedVersion.substring(4, 5); } return Float.parseFloat(str); } private static int getJavaVersionAsInt() { if (JAVA_VERSION == null) { return 0; } String trimmedVersion = trimJavaVersion(); String str = JAVA_VERSION.substring(0, 1); str = str + JAVA_VERSION.substring(2, 3); if (JAVA_VERSION.length() >= 5) { str = str + JAVA_VERSION.substring(4, 5); } else { str = str + "0"; } return Integer.parseInt(str); } private static String trimJavaVersion() { if (Character.isDigit(JAVA_VERSION.charAt(0))) { return JAVA_VERSION.substring( StringUtils.indexOf(JAVA_VERSION, "0123456789")); } else { return JAVA_VERSION; } } --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org