db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r419105 - in /db/torque/generator/trunk/src/java/org/apache/torque/task: TorqueDataModelTask.java TorqueDataSQLTask.java TorqueSQLExec.java
Date Tue, 04 Jul 2006 21:15:44 GMT
Author: tv
Date: Tue Jul  4 14:15:44 2006
New Revision: 419105

URL: http://svn.apache.org/viewvc?rev=419105&view=rev
Log:
Fixed ant deprecation issues

Modified:
    db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataModelTask.java
    db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataSQLTask.java
    db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueSQLExec.java

Modified: db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataModelTask.java
URL: http://svn.apache.org/viewvc/db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataModelTask.java?rev=419105&r1=419104&r2=419105&view=diff
==============================================================================
--- db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataModelTask.java (original)
+++ db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataModelTask.java Tue
Jul  4 14:15:44 2006
@@ -103,7 +103,7 @@
     public void setSqlDbMap(String sqldbmap)
     {
         //!! Make all these references files not strings.
-        this.sqldbmap = project.resolveFile(sqldbmap).toString();
+        this.sqldbmap = getProject().resolveFile(sqldbmap).toString();
     }
 
     /**
@@ -153,7 +153,7 @@
      */
     public void setXmlFile(String xmlFile)
     {
-        this.xmlFile = project.resolveFile(xmlFile).toString();
+        this.xmlFile = getProject().resolveFile(xmlFile).toString();
     }
 
     /**
@@ -241,8 +241,8 @@
                 for (int i = 0; i < filesets.size(); i++)
                 {
                     FileSet fs = (FileSet) filesets.get(i);
-                    DirectoryScanner ds = fs.getDirectoryScanner(project);
-                    File srcDir = fs.getDir(project);
+                    DirectoryScanner ds = fs.getDirectoryScanner(getProject());
+                    File srcDir = fs.getDir(getProject());
 
                     String[] dataModelFiles = ds.getIncludedFiles();
 

Modified: db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataSQLTask.java
URL: http://svn.apache.org/viewvc/db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataSQLTask.java?rev=419105&r1=419104&r2=419105&view=diff
==============================================================================
--- db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataSQLTask.java (original)
+++ db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueDataSQLTask.java Tue Jul
 4 14:15:44 2006
@@ -66,7 +66,7 @@
      */
     public void setDataXmlFile(String dataXmlFile)
     {
-        this.dataXmlFile = project.resolveFile(dataXmlFile).toString();
+        this.dataXmlFile = getProject().resolveFile(dataXmlFile).toString();
     }
 
     /**
@@ -117,7 +117,7 @@
      */
     public void setDataDTD(String dataDTD)
     {
-        this.dataDTD = project.resolveFile(dataDTD).toString();
+        this.dataDTD = getProject().resolveFile(dataDTD).toString();
     }
 
     /**
@@ -155,8 +155,8 @@
                 for (int i = 0; i < filesets.size(); i++)
                 {
                     FileSet fs = (FileSet) filesets.get(i);
-                    DirectoryScanner ds = fs.getDirectoryScanner(project);
-                    File srcDir = fs.getDir(project);
+                    DirectoryScanner ds = fs.getDirectoryScanner(getProject());
+                    File srcDir = fs.getDir(getProject());
 
                     String[] dataModelFiles = ds.getIncludedFiles();
 

Modified: db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueSQLExec.java
URL: http://svn.apache.org/viewvc/db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueSQLExec.java?rev=419105&r1=419104&r2=419105&view=diff
==============================================================================
--- db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueSQLExec.java (original)
+++ db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueSQLExec.java Tue Jul 
4 14:15:44 2006
@@ -18,21 +18,15 @@
 
 import java.io.BufferedOutputStream;
 import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
 import java.io.PrintStream;
-import java.io.StringReader;
 import java.io.Reader;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
+import java.io.StringReader;
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
 import java.sql.Driver;
@@ -41,11 +35,18 @@
 import java.sql.SQLException;
 import java.sql.SQLWarning;
 import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
 import org.apache.commons.lang.StringUtils;
 import org.apache.tools.ant.AntClassLoader;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
-import org.apache.tools.ant.ProjectHelper;
+import org.apache.tools.ant.PropertyHelper;
 import org.apache.tools.ant.Task;
 import org.apache.tools.ant.types.EnumeratedAttribute;
 import org.apache.tools.ant.types.Path;
@@ -147,7 +148,7 @@
      */
     public void setSqlDbMap(String sqldbmap)
     {
-        this.sqldbmap = project.resolveFile(sqldbmap);
+        this.sqldbmap = getProject().resolveFile(sqldbmap);
     }
 
     /**
@@ -167,7 +168,7 @@
      */
     public void setSrcDir(String srcDir)
     {
-        this.srcDir = project.resolveFile(srcDir).toString();
+        this.srcDir = getProject().resolveFile(srcDir).toString();
     }
 
     /**
@@ -206,7 +207,7 @@
     {
         if (this.classpath == null)
         {
-            this.classpath = new Path(project);
+            this.classpath = new Path(getProject());
         }
         return this.classpath.createPath();
     }
@@ -393,21 +394,21 @@
 
         if (driver == null)
         {
-            throw new BuildException("Driver attribute must be set!", location);
+            throw new BuildException("Driver attribute must be set!", getLocation());
         }
         if (userId == null)
         {
             throw new BuildException("User Id attribute must be set!",
-                    location);
+                    getLocation());
         }
         if (password == null)
         {
             throw new BuildException("Password attribute must be set!",
-                    location);
+                    getLocation());
         }
         if (url == null)
         {
-            throw new BuildException("Url attribute must be set!", location);
+            throw new BuildException("Url attribute must be set!", getLocation());
         }
 
         Properties map = new Properties();
@@ -503,7 +504,7 @@
                         + " using AntClassLoader with classpath " + classpath,
                         Project.MSG_VERBOSE);
 
-                loader = new AntClassLoader(project, classpath);
+                loader = new AntClassLoader(getProject(), classpath);
                 dc = loader.loadClass(driver);
             }
             else
@@ -517,17 +518,17 @@
         catch (ClassNotFoundException e)
         {
             throw new BuildException("Class Not Found: JDBC driver " + driver
-                    + " could not be loaded", location);
+                    + " could not be loaded", getLocation());
         }
         catch (IllegalAccessException e)
         {
             throw new BuildException("Illegal Access: JDBC driver " + driver
-                    + " could not be loaded", location);
+                    + " could not be loaded", getLocation());
         }
         catch (InstantiationException e)
         {
             throw new BuildException("Instantiation Exception: JDBC driver "
-                    + driver + " could not be loaded", location);
+                    + driver + " could not be loaded", getLocation());
         }
 
         try
@@ -595,7 +596,7 @@
                     // do nothing.
                 }
             }
-            throw new BuildException(e, location);
+            throw new BuildException(e, getLocation());
         }
         catch (SQLException e)
         {
@@ -610,7 +611,7 @@
                     // do nothing.
                 }
             }
-            throw new BuildException(e, location);
+            throw new BuildException(e, getLocation());
         }
         finally
         {
@@ -650,14 +651,14 @@
         String line = "";
 
         BufferedReader in = new BufferedReader(reader);
+        PropertyHelper ph = PropertyHelper.getPropertyHelper(getProject());
 
         try
         {
             while ((line = in.readLine()) != null)
             {
                 line = line.trim();
-                line = ProjectHelper.replaceProperties(project, line,
-                        project.getProperties());
+                line = ph.replaceProperties("", line, getProject().getProperties());
                 if (line.startsWith("//") || line.startsWith("--"))
                 {
                     continue;



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


Mime
View raw message