ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r405523 - in /ant/core/trunk/src/main/org/apache/tools/ant: MagicNames.java PropertyHelper.java util/ClasspathUtils.java
Date Tue, 09 May 2006 20:23:06 GMT
Author: stevel
Date: Tue May  9 13:23:03 2006
New Revision: 405523

URL: http://svn.apache.org/viewcvs?rev=405523&view=rev
Log:
Moving some magic names to a single file

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/MagicNames.java
    ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java
    ant/core/trunk/src/main/org/apache/tools/ant/util/ClasspathUtils.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/MagicNames.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/MagicNames.java?rev=405523&r1=405522&r2=405523&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/MagicNames.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/MagicNames.java Tue May  9 13:23:03 2006
@@ -144,5 +144,24 @@
      */
     public static final String BUILD_JAVAC_TARGET = "ant.build.javac.target";
 
+    /**
+     * Name of the magic property that controls classloader reuse 
+     * @since Ant 1.4.
+     * Value: {@value}
+     */
+    public static final String REFID_CLASSPATH_REUSE_LOADER = "ant.reuse.loader";
+
+    /**
+     * Prefix used to store classloader references.
+     * Value: {@value}
+     */
+    public static final String REFID_CLASSPATH_LOADER_PREFIX = "ant.loader.";
+
+    /**
+     * Reference used to store the property helper
+     * Value: {@value}
+     */
+    public static final String REFID_PROPERTY_HELPER = "ant.PropertyHelper";
+
 }
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java?rev=405523&r1=405522&r2=405523&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java Tue May  9 13:23:03 2006
@@ -124,14 +124,14 @@
     public static synchronized
         PropertyHelper getPropertyHelper(Project project) {
         PropertyHelper helper
-            = (PropertyHelper) project.getReference("ant.PropertyHelper");
+            = (PropertyHelper) project.getReference(MagicNames.REFID_PROPERTY_HELPER);
         if (helper != null) {
             return helper;
         }
         helper = new PropertyHelper();
         helper.setProject(project);
 
-        project.addReference("ant.PropertyHelper", helper);
+        project.addReference(MagicNames.REFID_PROPERTY_HELPER, helper);
         return helper;
     }
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/ClasspathUtils.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/util/ClasspathUtils.java?rev=405523&r1=405522&r2=405523&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/ClasspathUtils.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/ClasspathUtils.java Tue May  9 13:23:03
2006
@@ -20,6 +20,7 @@
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.ProjectComponent;
+import org.apache.tools.ant.MagicNames;
 import org.apache.tools.ant.types.Path;
 import org.apache.tools.ant.types.Reference;
 
@@ -64,11 +65,11 @@
  * @since Ant 1.6
  */
 public class ClasspathUtils {
-    private static final String LOADER_ID_PREFIX = "ant.loader.";
+
     /**
      * Name of the magic property that controls classloader reuse in Ant 1.4.
      */
-    public static final String REUSE_LOADER_REF = "ant.reuse.loader";
+    public static final String REUSE_LOADER_REF = MagicNames.REFID_CLASSPATH_REUSE_LOADER;
 
     /**
      * Convenience overloaded version of {@link
@@ -111,7 +112,7 @@
                     + pathId
                     + " does not reference a Path.");
         }
-        String loaderId = LOADER_ID_PREFIX + pathId;
+        String loaderId = MagicNames.REFID_CLASSPATH_LOADER_PREFIX + pathId;
         return getClassLoaderForPath(p, (Path) path, loaderId, reverseLoader);
     }
 
@@ -441,7 +442,7 @@
          * @return The class loader.
          */
         public ClassLoader getClassLoader() {
-            return ClasspathUtils.getClassLoaderForPath(
+            return getClassLoaderForPath(
                     getContextProject(),
                     this.classpath,
                     getClassLoadId(),
@@ -462,7 +463,7 @@
          */
         public String getClassLoadId() {
             return this.loaderId == null && this.classpathId != null
-                ? ClasspathUtils.LOADER_ID_PREFIX + this.classpathId
+                ? MagicNames.REFID_CLASSPATH_LOADER_PREFIX + this.classpathId
                 : this.loaderId;
         }
 



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


Mime
View raw message