From f5d573cf7d0525034c174bec7367e563116e6e33 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Mon, 16 May 2005 12:11:44 +0000 Subject: [PATCH] merged antlib: strings to a single (currently private) constant. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@278268 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/ComponentHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/org/apache/tools/ant/ComponentHelper.java b/src/main/org/apache/tools/ant/ComponentHelper.java index 7c3916a16..d0dec35b2 100644 --- a/src/main/org/apache/tools/ant/ComponentHelper.java +++ b/src/main/org/apache/tools/ant/ComponentHelper.java @@ -91,6 +91,7 @@ public class ComponentHelper { private static final String ERROR_NO_TASK_LIST_LOAD = "Can't load default task list"; private static final String ERROR_NO_TYPE_LIST_LOAD = "Can't load default type list"; public static final String COMPONENT_HELPER_REFERENCE = "ant.ComponentHelper"; + private static final String ANTLIB_PREFIX = "antlib:"; /** * Find a project component for a specific project, creating @@ -759,7 +760,7 @@ public class ComponentHelper { definer.setProject(project); definer.setURI(uri); definer.setResource( - uri.substring("antlib:".length()).replace('.', '/') + uri.substring(ANTLIB_PREFIX.length()).replace('.', '/') + "/antlib.xml"); // a fishing expedition :- ignore errors if antlib not present definer.setOnError(new Typedef.OnError("ignore")); @@ -791,7 +792,7 @@ public class ComponentHelper { AntTypeDefinition def = getDefinition(componentName); if (def == null) { //not a known type - boolean isAntlib=componentName.indexOf("antlib:")==0; + boolean isAntlib=componentName.indexOf(ANTLIB_PREFIX)==0; out.println("Cause: The name is undefined."); out.println("Action: Check the spelling."); out.println("Action: Check that any custom tasks/types have been declared");