From dev-return-78606-apmail-ant-dev-archive=ant.apache.org@ant.apache.org Sun Apr 08 12:07:02 2007 Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 87401 invoked from network); 8 Apr 2007 12:07:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Apr 2007 12:07:00 -0000 Received: (qmail 55210 invoked by uid 500); 8 Apr 2007 12:07:06 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 55164 invoked by uid 500); 8 Apr 2007 12:07:06 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 55153 invoked by uid 500); 8 Apr 2007 12:07:06 -0000 Received: (qmail 55150 invoked by uid 99); 8 Apr 2007 12:07:06 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Apr 2007 05:07:06 -0700 X-ASF-Spam-Status: No, hits=-99.5 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; Sun, 08 Apr 2007 05:06:59 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 305791A9838; Sun, 8 Apr 2007 05:06:39 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r526542 - in /ant/core/trunk/src/main/org/apache/tools/ant: taskdefs/Manifest.java taskdefs/Property.java taskdefs/optional/perforce/P4Fstat.java util/ReflectUtil.java util/ScriptRunnerCreator.java Date: Sun, 08 Apr 2007 12:06:39 -0000 To: ant-cvs@apache.org From: jkf@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070408120639.305791A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jkf Date: Sun Apr 8 05:06:38 2007 New Revision: 526542 URL: http://svn.apache.org/viewvc?view=rev&rev=526542 Log: Changes after static code analysis. Code changed. Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Manifest.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Property.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Fstat.java ant/core/trunk/src/main/org/apache/tools/ant/util/ReflectUtil.java ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerCreator.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Manifest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Manifest.java?view=diff&rev=526542&r1=526541&r2=526542 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Manifest.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Manifest.java Sun Apr 8 05:06:38 2007 @@ -182,8 +182,7 @@ String lhsKey = getKey(); String rhsKey = rhsAttribute.getKey(); if ((lhsKey == null && rhsKey != null) - || (lhsKey != null && rhsKey == null) - || !lhsKey.equals(rhsKey)) { + || (lhsKey != null && !lhsKey.equals(rhsKey))) { return false; } Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Property.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Property.java?view=diff&rev=526542&r1=526541&r2=526542 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Property.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Property.java Sun Apr 8 05:06:38 2007 @@ -452,8 +452,9 @@ log("Loading " + file.getAbsolutePath(), Project.MSG_VERBOSE); try { if (file.exists()) { - FileInputStream fis = new FileInputStream(file); + FileInputStream fis = null; try { + fis = new FileInputStream(file); props.load(fis); } finally { if (fis != null) { Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Fstat.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Fstat.java?view=diff&rev=526542&r1=526541&r2=526542 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Fstat.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Fstat.java Sun Apr 8 05:06:38 2007 @@ -134,9 +134,9 @@ DirectoryScanner ds = fs.getDirectoryScanner(getProject()); String[] srcFiles = ds.getIncludedFiles(); - fileNum = srcFiles.length; if (srcFiles != null) { + fileNum = srcFiles.length; for (int j = 0; j < srcFiles.length; j++) { File f = new File(ds.getBasedir(), srcFiles[j]); filelist.append(" ").append('"').append(f.getAbsolutePath()).append('"'); Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/ReflectUtil.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/ReflectUtil.java?view=diff&rev=526542&r1=526541&r2=526542 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/util/ReflectUtil.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/util/ReflectUtil.java Sun Apr 8 05:06:38 2007 @@ -125,18 +125,28 @@ */ public static void throwBuildException(Exception t) throws BuildException { + throw toBuildException(t); + } + + /** + * A method to convert an invocationTargetException to + * a buildexception. + * @param t the invocation target exception. + * @since ant 1.7.1 + */ + public static BuildException toBuildException(Exception t) { if (t instanceof InvocationTargetException) { Throwable t2 = ((InvocationTargetException) t) .getTargetException(); if (t2 instanceof BuildException) { - throw (BuildException) t2; + return (BuildException) t2; } - throw new BuildException(t2); + return new BuildException(t2); } else { - throw new BuildException(t); + return new BuildException(t); } } - + /** * A method to test if an object responds to a given * message (method call) Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerCreator.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerCreator.java?view=diff&rev=526542&r1=526541&r2=526542 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerCreator.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerCreator.java Sun Apr 8 05:06:38 2007 @@ -130,10 +130,8 @@ runnerClass, true, scriptLoader).newInstance(); runner.setProject(project); } catch (Exception ex) { - ReflectUtil.throwBuildException(ex); - // NotReached + throw ReflectUtil.toBuildException(ex); } - runner.setLanguage(language); runner.setScriptClassLoader(scriptLoader); return runner; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org