Browse Source

antlib: is a magic name

master
twogee 5 years ago
parent
commit
bf7c94af20
3 changed files with 5 additions and 5 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/ComponentHelper.java
  2. +2
    -2
      src/main/org/apache/tools/ant/ProjectHelper.java
  3. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Definer.java

+ 1
- 1
src/main/org/apache/tools/ant/ComponentHelper.java View File

@@ -824,7 +824,7 @@ public class ComponentHelper {
if (uri.isEmpty()) {
uri = ProjectHelper.ANT_CORE_URI;
}
if (!uri.startsWith(ProjectHelper.ANTLIB_URI)) {
if (!uri.startsWith(MagicNames.ANTLIB_PREFIX)) {
return; // namespace that does not contain antlib
}
if (checkedNamespaces.contains(uri)) {


+ 2
- 2
src/main/org/apache/tools/ant/ProjectHelper.java View File

@@ -38,7 +38,7 @@ import org.xml.sax.AttributeList;
*/
public class ProjectHelper {
/** The URI for ant name space */
public static final String ANT_CORE_URI = "antlib:org.apache.tools.ant";
public static final String ANT_CORE_URI = MagicNames.ANTLIB_PREFIX + "org.apache.tools.ant";

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

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

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


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Definer.java View File

@@ -463,12 +463,12 @@ public abstract class Definer extends DefBase {
if (definerSet) {
tooManyDefinitions();
}
if (!antlib.startsWith("antlib:")) {
if (!antlib.startsWith(MagicNames.ANTLIB_PREFIX)) {
throw new BuildException(
"Invalid antlib attribute - it must start with antlib:");
}
setURI(antlib);
this.resource = antlib.substring("antlib:".length()).replace('.', '/')
this.resource = antlib.substring(MagicNames.ANTLIB_PREFIX.length()).replace('.', '/')
+ "/antlib.xml";
definerSet = true;
}


Loading…
Cancel
Save