openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r618762 - /openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java
Date Tue, 05 Feb 2008 20:01:14 GMT
Author: mikedd
Date: Tue Feb  5 12:01:12 2008
New Revision: 618762

URL: http://svn.apache.org/viewvc?rev=618762&view=rev
Log:
revert OPENJPA-401 in 1.0.x - shouldn't add a new flag in a service stream.

Modified:
    openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java

Modified: openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java?rev=618762&r1=618761&r2=618762&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java
(original)
+++ openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java
Tue Feb  5 12:01:12 2008
@@ -49,7 +49,6 @@
  * <li><code>file</code></li>
  * <li><code>schemaFile</code></li>
  * <li><code>sqlFile</code></li>
- * <li><code>tmpClassLoader</code></li>
  * </ul> Of these arguments, only <code>action</code> is required.
  */
 public class MappingToolTask
@@ -62,7 +61,6 @@
     protected String file = null;
     protected String schemaFile = null;
     protected String sqlFile = null;
-    protected boolean tmpClassLoader = true;
 
     /**
      * Set the enumerated MappingTool action type.
@@ -177,28 +175,22 @@
         throws Exception {
         if (MappingTool.ACTION_IMPORT.equals(flags.action))
             assertFiles(files);
-        ClassLoader toolLoader = (ClassLoader) AccessController
-                .doPrivileged(J2DoPrivHelper
-                        .getClassLoaderAction(MappingTool.class));
-        ClassLoader loader = toolLoader;
-        MultiLoaderClassResolver resolver = new MultiLoaderClassResolver();
-
-        if (tmpClassLoader) {
-            loader = (ClassLoader) AccessController.doPrivileged(J2DoPrivHelper
-
-            .newTemporaryClassLoaderAction(getClassLoader()));
-            resolver.addClassLoader(loader);
-        }
-        resolver.addClassLoader(toolLoader);
 
+        ClassLoader loader =
+            (ClassLoader) AccessController.doPrivileged(J2DoPrivHelper
+                    .newTemporaryClassLoaderAction(getClassLoader()));
+        
         if (flags.meta && MappingTool.ACTION_ADD.equals(flags.action))
             flags.metaDataFile = Files.getFile(file, loader);
         else
             flags.mappingWriter = Files.getWriter(file, loader);
-        
         flags.schemaWriter = Files.getWriter(schemaFile, loader);
         flags.sqlWriter = Files.getWriter(sqlFile, loader);
 
+        MultiLoaderClassResolver resolver = new MultiLoaderClassResolver();
+        resolver.addClassLoader((ClassLoader) AccessController.doPrivileged(
+            J2DoPrivHelper.getClassLoaderAction(MappingTool.class)));
+        resolver.addClassLoader(loader);
         JDBCConfiguration conf = (JDBCConfiguration) getConfiguration();
         conf.setClassResolver(resolver);
         
@@ -225,19 +217,6 @@
             actions[actions.length - 1] = "none";
             return actions;
         }
-    }
-
-    /**
-     * <P>
-     * Set whether a temporary ClassLoader should be used by the MappingTool.
-     * The default value is true
-     * </P>
-     * 
-     * @param tmpClassLoader
-     *            Whether the temporary ClassLoader should be used.
-     */
-    public void setTmpClassLoader(boolean tmpClassLoader) {
-        this.tmpClassLoader = tmpClassLoader;
     }
 }
 



Mime
View raw message