Return-Path: Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: (qmail 8547 invoked from network); 17 Nov 2009 23:56:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Nov 2009 23:56:44 -0000 Received: (qmail 54766 invoked by uid 500); 17 Nov 2009 23:56:44 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 54691 invoked by uid 500); 17 Nov 2009 23:56:44 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 54682 invoked by uid 99); 17 Nov 2009 23:56:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Nov 2009 23:56:44 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Nov 2009 23:56:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 086572388904; Tue, 17 Nov 2009 23:56:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r881627 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SubAnt.java Date: Tue, 17 Nov 2009 23:56:21 -0000 To: notifications@ant.apache.org From: jglick@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091117235622.086572388904@eris.apache.org> Author: jglick Date: Tue Nov 17 23:56:21 2009 New Revision: 881627 URL: http://svn.apache.org/viewvc?rev=881627&view=rev Log: Fixing fix for OOME in . Was getting wrapped in BuildException by both DispatchUtils.execute and Project.executeSortedTargets. Instead of trying to prevent wrapping, which is difficult to enforce, just die on wrapped hard errors. Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SubAnt.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SubAnt.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SubAnt.java?rev=881627&r1=881626&r2=881627&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SubAnt.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SubAnt.java Tue Nov 17 23:56:21 2009 @@ -301,18 +301,14 @@ try { ant.execute(); } catch (BuildException e) { - if (failOnError) { + if (failOnError || isHardError(e)) { throw e; } log("Failure for target '" + subTarget + "' of: " + antfilename + "\n" + e.getMessage(), Project.MSG_WARN); - } catch (OutOfMemoryError e) { - throw e; - } catch (ThreadDeath e) { - throw e; } catch (Throwable e) { - if (failOnError) { + if (failOnError || isHardError(e)) { throw new BuildException(e); } log("Failure for target '" + subTarget @@ -323,6 +319,18 @@ ant = null; } } + /** whether we should even try to continue after this error */ + private boolean isHardError(Throwable t) { + if (t instanceof BuildException) { + return isHardError(t.getCause()); + } else if (t instanceof OutOfMemoryError) { + return true; + } else if (t instanceof ThreadDeath) { + return true; + } else { // incl. t == null + return false; + } + } /** * This method builds the file name to use in conjunction with directories.