ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r710060 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
Date Mon, 03 Nov 2008 14:10:37 GMT
Author: bodewig
Date: Mon Nov  3 06:10:37 2008
New Revision: 710060

URL: http://svn.apache.org/viewvc?rev=710060&view=rev
Log:
Improve fixcrlf's error messages.  PR 43936.

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java?rev=710060&r1=710059&r2=710060&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java Mon Nov  3 06:10:37
2008
@@ -221,7 +221,9 @@
         try {
             filter.setTablength(tlength);
         } catch (IOException e) {
-            throw new BuildException(e);
+            // filter.setTablength throws IOException that would better be
+            // a BuildException
+            throw new BuildException(e.getMessage(), e);
         }
     }
 
@@ -361,7 +363,7 @@
             boolean destIsWrong = true;
             if (destFile.exists()) {
                 // Compare the destination with the temp file
-                log("destFile exists", Project.MSG_DEBUG);
+                log("destFile " + destFile + " exists", Project.MSG_DEBUG);
                 destIsWrong = !FILE_UTILS.contentEquals(destFile, tmpFile);
                 log(destFile + (destIsWrong ? " is being written"
                     : " is not written, as the contents are identical"),
@@ -370,13 +372,14 @@
             if (destIsWrong) {
                 FILE_UTILS.rename(tmpFile, destFile);
                 if (preserveLastModified) {
-                    log("preserved lastModified", Project.MSG_DEBUG);
+                    log("preserved lastModified for " + destFile,
+                        Project.MSG_DEBUG);
                     FILE_UTILS.setFileLastModified(destFile, lastModified);
                 }
                 tmpFile = null;
             }
         } catch (IOException e) {
-            throw new BuildException(e);
+            throw new BuildException("error running fixcrlf on file " + srcFile, e);
         }
     }
 



Mime
View raw message