Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 32554 invoked from network); 18 Oct 2009 22:56:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Oct 2009 22:56:54 -0000 Received: (qmail 70781 invoked by uid 500); 18 Oct 2009 22:56:54 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 70685 invoked by uid 500); 18 Oct 2009 22:56:54 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 70675 invoked by uid 99); 18 Oct 2009 22:56:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Oct 2009 22:56:53 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Oct 2009 22:56:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4BA10234C045 for ; Sun, 18 Oct 2009 15:56:31 -0700 (PDT) Message-ID: <1782607892.1255906591298.JavaMail.jira@brutus> Date: Sun, 18 Oct 2009 15:56:31 -0700 (PDT) From: "Wim (JIRA)" To: issues@commons.apache.org Subject: [jira] Created: (LANG-539) Compile commons.lang for CDC 1.1/Foundation 1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Compile commons.lang for CDC 1.1/Foundation 1.1 ----------------------------------------------- Key: LANG-539 URL: https://issues.apache.org/jira/browse/LANG-539 Project: Commons Lang Issue Type: Wish Affects Versions: 2.4 Reporter: Wim Fix For: 2.x I try to compile the commons.lang for use on small memory devices. All classes compile fine against CDC 1.1/Foundation 1.1 except ExceptionUtils which uses the SQLException class which is not defined in this environment. Is it possible to replace the source with the reflection version: Index: ExceptionUtils.java =================================================================== --- ExceptionUtils.java (revision 32) +++ ExceptionUtils.java (working copy) @@ -22,7 +22,6 @@ import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -361,8 +360,13 @@ private static Throwable getCauseUsingWellKnownTypes(Throwable throwable) { if (throwable instanceof Nestable) { return ((Nestable) throwable).getCause(); - } else if (throwable instanceof SQLException) { - return ((SQLException) throwable).getNextException(); + } else if (throwable.getClass().getName().equals("java.sql.SQLException")) { + try { + return (Throwable) throwable.getClass().getMethod("getNextException", null).invoke(throwable, null); + } catch (Exception e) { + // Should not happen + return null; + } } else if (throwable instanceof InvocationTargetException) { return ((InvocationTargetException) throwable).getTargetException(); } else { @@ -459,7 +463,7 @@ if (throwable instanceof Nestable) { return true; - } else if (throwable instanceof SQLException) { + } else if (throwable.getClass().getName().equals("java.sql.SQLException")) { return true; } else if (throwable instanceof InvocationTargetException) { return true; -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.