ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1342959 - in /ant/core/trunk: WHATSNEW manual/Tasks/fixcrlf.html src/main/org/apache/tools/ant/filters/FixCrLfFilter.java
Date Sat, 26 May 2012 20:48:39 GMT
Author: jkf
Date: Sat May 26 20:48:39 2012
New Revision: 1342959

URL: http://svn.apache.org/viewvc?rev=1342959&view=rev
Log:
Bug 53036 - FixCRLF does not respect the eol="asis" setting

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/manual/Tasks/fixcrlf.html
    ant/core/trunk/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=1342959&r1=1342958&r2=1342959&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Sat May 26 20:48:39 2012
@@ -4,6 +4,13 @@ Changes from Ant 1.8.4 TO Ant 1.9.0
 Changes that could break older environments:
 -------------------------------------------
 
+ * FixCRLF used to treat the EOL value ASIS to convert to the system property 
+   line.separator. Specified was that ASIS would leave the EOL characters alone,
+   the task now really leaves the EOL characters alone. This also implies that
+   EOL ASIS will not insert a newline even if fixlast is set to true.
+   Bugzilla report 53036
+   
+
 Fixed bugs:
 -----------
 

Modified: ant/core/trunk/manual/Tasks/fixcrlf.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/manual/Tasks/fixcrlf.html?rev=1342959&r1=1342958&r2=1342959&view=diff
==============================================================================
--- ant/core/trunk/manual/Tasks/fixcrlf.html (original)
+++ ant/core/trunk/manual/Tasks/fixcrlf.html Sat May 26 20:48:39 2012
@@ -280,7 +280,7 @@
   <tr>
     <td valign="top">fixlast</td>
     <td valign="top">Whether to add a missing EOL to the last line
-                     of a processed file. <b>Since Ant 1.6.1</b></td>
+                     of a processed file.<br/>Ignored if EOL is asis.<br/><b>Since
Ant 1.6.1</b></td>
     <td align="center" colspan="2">No; default is <i>true</i></td>
   </tr>
 </table>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java?rev=1342959&r1=1342958&r2=1342959&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/filters/FixCrLfFilter.java Sat May 26 20:48:39
2012
@@ -239,9 +239,6 @@ public final class FixCrLfFilter extends
 
     private static String calculateEolString(CrLf eol) {
         // Calculate the EOL string per the current config
-        if (eol == CrLf.ASIS) {
-            return System.getProperty("line.separator");
-        }
         if (eol == CrLf.CR || eol == CrLf.MAC) {
             return "\r";
         }
@@ -265,7 +262,10 @@ public final class FixCrLfFilter extends
         // Change all EOL characters to match the calculated EOL string. If
         // configured to do so, append a trailing EOL so that the file ends on
         // a EOL.
-        in = new NormalizeEolFilter(in, calculateEolString(eol), getFixlast());
+        if (eol != CrLf.ASIS)
+        {
+            in = new NormalizeEolFilter(in, calculateEolString(eol), getFixlast());
+        }
 
         if (tabs != AddAsisRemove.ASIS) {
             // If filtering Java source, prevent changes to whitespace in



Mime
View raw message