ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r526541 - in /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional: jlink/jlink.java junit/JUnitVersionHelper.java
Date Sun, 08 Apr 2007 12:05:04 GMT
Author: jkf
Date: Sun Apr  8 05:05:03 2007
New Revision: 526541

URL: http://svn.apache.org/viewvc?view=rev&rev=526541
Log:
Changes after static code analysis.
Code changed.

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java?view=diff&rev=526541&r1=526540&r2=526541
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/jlink/jlink.java Sun Apr
 8 05:05:03 2007
@@ -22,6 +22,8 @@
  */
 package org.apache.tools.ant.taskdefs.optional.jlink;
 
+import org.apache.tools.ant.util.FileUtils;
+
 import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -180,13 +182,7 @@
                 addFile(output, f, "", compression);
             }
         }
-        if (output != null) {
-            try {
-                output.close();
-            } catch (IOException ioe) {
-                //do nothing
-            }
-        }
+        FileUtils.close(output);
     }
 
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java?view=diff&rev=526541&r1=526540&r2=526541
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java
Sun Apr  8 05:05:03 2007
@@ -58,7 +58,11 @@
      * @return the name of the test.
      */
     public static String getTestCaseName(Test t) {
-        if (t != null && t.getClass().getName().equals("junit.framework.JUnit4TestCaseFacade"))
{
+        if (t == null)
+        {
+            return "unknown";
+        }
+        if (t.getClass().getName().equals("junit.framework.JUnit4TestCaseFacade")) {
             // Self-describing as of JUnit 4 (#38811). But trim "(ClassName)".
             String name = t.toString();
             if (name.endsWith(")")) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message