ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r559634 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Property.java
Date Wed, 25 Jul 2007 22:34:28 GMT
Author: mbenson
Date: Wed Jul 25 15:34:21 2007
New Revision: 559634

URL: http://svn.apache.org/viewvc?view=rev&rev=559634
Log:
fmt; FileUtils.close(); remove unnecessary return stmt

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Property.java

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=559634&r1=559633&r2=559634
==============================================================================
--- 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 Wed Jul 25 15:34:21
2007
@@ -37,6 +37,7 @@
 import org.apache.tools.ant.Task;
 import org.apache.tools.ant.types.Path;
 import org.apache.tools.ant.types.Reference;
+import org.apache.tools.ant.util.FileUtils;
 
 /**
  * Sets a property by name, or set of properties (from file or
@@ -529,12 +530,12 @@
             // load the xml based property definition 
             // use reflection because of bwc to Java 1.3
             try {
-                Method loadXmlMethod = props.getClass().getMethod("loadFromXML", new Class[]{InputStream.class});
-                loadXmlMethod.invoke(props, new Object[]{is});
+                Method loadXmlMethod = props.getClass().getMethod("loadFromXML",
+                        new Class[] { InputStream.class });
+                loadXmlMethod.invoke(props, new Object[] { is });
             } catch (NoSuchMethodException e) {
                 e.printStackTrace();
                 log("Can not load xml based property definition on Java < 5");
-                return;
             } catch (Exception e) {
                 // no-op
                 e.printStackTrace();
@@ -545,7 +546,6 @@
         }
     }
 
-
     /**
      * load properties from a file
      * @param file file to load
@@ -561,14 +561,12 @@
                     fis = new FileInputStream(file);
                     loadProperties(props, fis, file.getName().endsWith(".xml"));
                 } finally {
-                    if (fis != null) {
-                        fis.close();
-                    }
+                    FileUtils.close(fis);
                 }
                 addProperties(props);
             } else {
                 log("Unable to find property file: " + file.getAbsolutePath(),
-                    Project.MSG_VERBOSE);
+                        Project.MSG_VERBOSE);
             }
         } catch (IOException ex) {
             throw new BuildException(ex, getLocation());



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


Mime
View raw message