Skip to content

Commit bf7c94a

Browse files
committed
antlib: is a magic name
1 parent ae32a21 commit bf7c94a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/main/org/apache/tools/ant/ComponentHelper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ private synchronized void checkNamespace(String componentName) {
824824
if (uri.isEmpty()) {
825825
uri = ProjectHelper.ANT_CORE_URI;
826826
}
827-
if (!uri.startsWith(ProjectHelper.ANTLIB_URI)) {
827+
if (!uri.startsWith(MagicNames.ANTLIB_PREFIX)) {
828828
return; // namespace that does not contain antlib
829829
}
830830
if (checkedNamespaces.contains(uri)) {

src/main/org/apache/tools/ant/ProjectHelper.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*/
3939
public class ProjectHelper {
4040
/** The URI for ant name space */
41-
public static final String ANT_CORE_URI = "antlib:org.apache.tools.ant";
41+
public static final String ANT_CORE_URI = MagicNames.ANTLIB_PREFIX + "org.apache.tools.ant";
4242

4343
/** The URI for antlib current definitions */
4444
public static final String ANT_CURRENT_URI = "ant:current";
@@ -49,7 +49,7 @@ public class ProjectHelper {
4949
public static final String ANT_ATTRIBUTE_URI = "ant:attribute";
5050

5151
/** The URI for defined types/tasks - the format is antlib:<package> */
52-
public static final String ANTLIB_URI = "antlib:";
52+
public static final String ANTLIB_URI = MagicNames.ANTLIB_PREFIX;
5353

5454
/** Polymorphic attribute */
5555
public static final String ANT_TYPE = "ant-type";

src/main/org/apache/tools/ant/taskdefs/Definer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,12 @@ public void setAntlib(String antlib) {
463463
if (definerSet) {
464464
tooManyDefinitions();
465465
}
466-
if (!antlib.startsWith("antlib:")) {
466+
if (!antlib.startsWith(MagicNames.ANTLIB_PREFIX)) {
467467
throw new BuildException(
468468
"Invalid antlib attribute - it must start with antlib:");
469469
}
470470
setURI(antlib);
471-
this.resource = antlib.substring("antlib:".length()).replace('.', '/')
471+
this.resource = antlib.substring(MagicNames.ANTLIB_PREFIX.length()).replace('.', '/')
472472
+ "/antlib.xml";
473473
definerSet = true;
474474
}

0 commit comments

Comments
 (0)