Author: kevj Date: Mon Mar 19 00:02:30 2007 New Revision: 519857 URL: http://svn.apache.org/viewvc?view=rev&rev=519857 Log: -revert to non-reflective close
Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java?view=diff&rev=519857&r1=519856&r2=519857 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java Mon Mar 19 00:02:30 2007 @@ -26,7 +26,6 @@ import java.io.Reader; import java.io.UnsupportedEncodingException; import java.io.Writer; -import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.text.DecimalFormat; @@ -1300,20 +1299,6 @@ public boolean isUpToDate(long sourceTime, long destTime) { return isUpToDate(sourceTime, destTime, getFileTimestampGranularity()); } - - - private static void closeQuietly(Object o) { - if (null == o) { - return; - } - try { - if(ReflectUtil.respondsTo(o, "close")) { - ReflectUtil.invoke(o, "close"); - } - } catch(Exception e) { - //ignore - } - } /** * Close a Writer without throwing any exception if something went wrong. @@ -1321,7 +1306,13 @@ * @param device output writer, can be null. */ public static void close(Writer device) { - closeQuietly(device); + if(null != device){ + try { + device.close(); + } catch (IOException e) { + //ignore + } + } } /** @@ -1331,7 +1322,13 @@ * @param device Reader, can be null. */ public static void close(Reader device) { - closeQuietly(device); + if(null != device){ + try { + device.close(); + } catch (IOException e) { + //ignore + } + } } /** @@ -1341,7 +1338,13 @@ * @param device stream, can be null. */ public static void close(OutputStream device) { - closeQuietly(device); + if(null != device){ + try { + device.close(); + } catch (IOException e) { + //ignore + } + } } /** @@ -1351,7 +1354,13 @@ * @param device stream, can be null. */ public static void close(InputStream device) { - closeQuietly(device); + if(null != device){ + try { + device.close(); + } catch (IOException e) { + //ignore + } + } } /** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]