[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ant-dev
Subject:    svn commit: r491347 - in /ant/core/trunk: WHATSNEW
From:       peterreilly () apache ! org
Date:       2006-12-30 23:51:06
Message-ID: 20061230235106.880B01A981A () eris ! apache ! org
[Download RAW message or body]

Author: peterreilly
Date: Sat Dec 30 15:51:05 2006
New Revision: 491347

URL: http://svn.apache.org/viewvc?view=rev&rev=491347
Log:
Bugzilla 41264: douple expansion in <sql>

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/docs/manual/CoreTasks/sql.html
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=491347&r1=491346&r2=491347
 ==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Sat Dec 30 15:51:05 2006
@@ -20,6 +20,9 @@
 * Target from imported file listed twice in projecthelp.
   Bugzilla report 41226.
 
+* <sql> task double-expands properties if expandproperties is true,
+  and expands properties if expandproperties is false.
+  Bugzilla report 41204.
 
 Other changes:
 --------------

Modified: ant/core/trunk/docs/manual/CoreTasks/sql.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/sql.html?view=diff&rev=491347&r1=491346&r2=491347
 ==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/sql.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/sql.html Sat Dec 30 15:51:05 2006
@@ -185,7 +185,7 @@
   <td width="12%" valign="top">expandproperties</td>
   <td width="78%" valign="top">Set to true to turn on property expansion in
   nested SQL, inline in the task or nested transactions. <em>Since Ant 1.7</em>.
-  <td width="10%" valign="top">No (default=false)</td>
+  <td width="10%" valign="top">No (default=true)</td>
 </tr>
 
 </table>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java?view=diff&rev=491347&r1=491346&r2=491347
 ==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java Sat Dec 30 \
15:51:05 2006 @@ -190,7 +190,7 @@
      *
      * @since Ant 1.7
      */
-    private boolean expandProperties = false;
+    private boolean expandProperties = true;
 
     /**
      * Set the name of the SQL file to be run.
@@ -491,7 +491,9 @@
             if (!keepformat) {
                 line = line.trim();
             }
-            line = getProject().replaceProperties(line);
+            if (expandProperties) {
+                line = getProject().replaceProperties(line);
+            }
             if (!keepformat) {
                 if (line.startsWith("//")) {
                     continue;
@@ -738,9 +740,6 @@
          */
         public void addText(String sql) {
             if (sql != null) {
-                if (getExpandProperties()) {
-                    sql = getProject().replaceProperties(sql);
-                }
                 this.tSqlCommand += sql;
             }
         }



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic