stevel 2005/08/22 14:24:22 Modified: src/main/org/apache/tools/ant ComponentHelper.java MagicNames.java src/main/org/apache/tools/ant/launch Launcher.java Log: just making some strings constants, adding javadocs Revision Changes Path 1.60 +10 -4 ant/src/main/org/apache/tools/ant/ComponentHelper.java Index: ComponentHelper.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v retrieving revision 1.59 retrieving revision 1.60 diff -u -r1.59 -r1.60 --- ComponentHelper.java 22 Aug 2005 16:51:16 -0000 1.59 +++ ComponentHelper.java 22 Aug 2005 21:24:22 -0000 1.60 @@ -94,6 +94,12 @@ private static final String ANTLIB_PREFIX = "antlib:"; /** + * string used to control build.syspath policy [EMAIL PROTECTED] + */ + private static final String BUILD_SYSCLASSPATH_ONLY = "only"; + private static final String ANT_PROPERTY_TASK = "property"; + + /** * Find a project component for a specific project, creating * it if it does not exist. * @param project the project. @@ -435,10 +441,10 @@ */ public Task createTask(String taskType) throws BuildException { Task task = createNewTask(taskType); - if (task == null && taskType.equals("property")) { + if (task == null && taskType.equals(ANT_PROPERTY_TASK)) { // quick fix for Ant.java use of property before // initializing the project - addTaskDefinition("property", + addTaskDefinition(ANT_PROPERTY_TASK, org.apache.tools.ant.taskdefs.Property.class); task = createNewTask(taskType); } @@ -676,7 +682,7 @@ private void initTasks() { ClassLoader classLoader = null; if (project.getCoreLoader() != null - && !("only".equals(project.getProperty("build.sysclasspath")))) { + && !(BUILD_SYSCLASSPATH_ONLY.equals(project.getProperty(MagicNames.BUILD_SYSCLASSPATH)))) { classLoader = project.getCoreLoader(); } String dataDefs = MagicNames.TASKDEF_PROPERTIES_RESOURCE; @@ -721,7 +727,7 @@ private void initTypes() { ClassLoader classLoader = null; if (project.getCoreLoader() != null - && !("only".equals(project.getProperty("build.sysclasspath")))) { + && !(BUILD_SYSCLASSPATH_ONLY.equals(project.getProperty(MagicNames.BUILD_SYSCLASSPATH)))) { classLoader = project.getCoreLoader(); } String dataDefs = MagicNames.TYPEDEFS_PROPERTIES_RESOURCE; 1.10 +8 -3 ant/src/main/org/apache/tools/ant/MagicNames.java Index: MagicNames.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/MagicNames.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- MagicNames.java 10 Jun 2005 23:06:10 -0000 1.9 +++ MagicNames.java 22 Aug 2005 21:24:22 -0000 1.10 @@ -24,14 +24,19 @@ * @since Ant 1.6 */ public final class MagicNames { + + private MagicNames() { + } + /** * Ant version property. [EMAIL PROTECTED] */ public static final String ANT_VERSION = "ant.version"; - private MagicNames() { - } - + /** + * System classpath policy. [EMAIL PROTECTED] + */ + public static final String BUILD_SYSCLASSPATH = "build.sysclasspath"; /** * The name of the script repository used by the script repo task 1.33 +22 -6 ant/src/main/org/apache/tools/ant/launch/Launcher.java Index: Launcher.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/launch/Launcher.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- Launcher.java 9 Aug 2005 15:24:52 -0000 1.32 +++ Launcher.java 22 Aug 2005 21:24:22 -0000 1.33 @@ -41,26 +41,42 @@ /** The Ant Library Directory property */ public static final String ANTLIBDIR_PROPERTY = "ant.library.dir"; - /** The directory name of the per-user ant directory */ + /** + * The directory name of the per-user ant directory + * [EMAIL PROTECTED] + */ public static final String ANT_PRIVATEDIR = ".ant"; /** - * The location of a per-user library directory + * The name of a per-user library directory + * [EMAIL PROTECTED] */ public static final String ANT_PRIVATELIB = "lib"; - /** The location of a per-user library directory */ + /** The location of a per-user library directory + * [EMAIL PROTECTED] + */ public static final String USER_LIBDIR = ANT_PRIVATEDIR + File.separatorChar + ANT_PRIVATELIB; - /** The startup class that is to be run */ + /** + * The startup class that is to be run + * [EMAIL PROTECTED] + */ public static final String MAIN_CLASS = "org.apache.tools.ant.Main"; /** * system property with user home directory + * [EMAIL PROTECTED] */ public static final String USER_HOMEDIR = "user.home"; /** + * System property of + * [EMAIL PROTECTED] + */ + private static final String JAVA_CLASS_PATH = "java.class.path"; + + /** * Entry point for starting command line Ant * * @param args commandline arguments @@ -228,7 +244,7 @@ // now update the class.path property StringBuffer baseClassPath - = new StringBuffer(System.getProperty("java.class.path")); + = new StringBuffer(System.getProperty(JAVA_CLASS_PATH)); if (baseClassPath.charAt(baseClassPath.length() - 1) == File.pathSeparatorChar) { baseClassPath.setLength(baseClassPath.length() - 1); @@ -239,7 +255,7 @@ baseClassPath.append(Locator.fromURI(jars[i].toString())); } - System.setProperty("java.class.path", baseClassPath.toString()); + System.setProperty(JAVA_CLASS_PATH, baseClassPath.toString()); URLClassLoader loader = new URLClassLoader(jars); Thread.currentThread().setContextClassLoader(loader);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]