peterreilly    2003/09/01 07:15:30

  Modified:    src/main/org/apache/tools/ant ProjectHelper.java
                        ComponentHelper.java
  Log:
  Place antlibs temp defintions in a ant:current namespace.
  
  Revision  Changes    Path
  1.100     +3 -0      ant/src/main/org/apache/tools/ant/ProjectHelper.java
  
  Index: ProjectHelper.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ProjectHelper.java,v
  retrieving revision 1.99
  retrieving revision 1.100
  diff -u -r1.99 -r1.100
  --- ProjectHelper.java        13 Aug 2003 13:18:54 -0000      1.99
  +++ ProjectHelper.java        1 Sep 2003 14:15:30 -0000       1.100
  @@ -88,6 +88,9 @@
       /** The URI for ant name space */
       public static final String ANT_CORE_URI       = "ant:core";
   
  +    /** The URI for antlib current definitions */
  +    public static final String ANT_CURRENT_URI      = "ant:current";
  +
       /** The URI for defined types/tasks - the format is antlib:<package> */
       public static final String ANTLIB_URI     = "antlib:";
   
  
  
  
  1.26      +13 -9     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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- ComponentHelper.java      15 Aug 2003 15:04:29 -0000      1.25
  +++ ComponentHelper.java      1 Sep 2003 14:15:30 -0000       1.26
  @@ -112,7 +112,7 @@
        */
       private Stack antLibStack = new Stack();
       /** current antlib context */
  -    private AntTypeTable antLibTypeTable = null;
  +    private AntTypeTable antLibCurrentTypeTable = null;
   
       /**
        * Map from task names to vectors of created tasks
  @@ -268,8 +268,10 @@
       public AntTypeDefinition getDefinition(String componentName) {
           checkNamespace(componentName);
           AntTypeDefinition ret = null;
  -        if (antLibTypeTable != null && componentName.indexOf(':') == -1) {
  -            ret = antLibTypeTable.getDefinition(componentName);
  +        if (antLibCurrentTypeTable != null
  +            && ProjectHelper.ANT_CURRENT_URI.equals(
  +                ProjectHelper.extractUriFromComponentName(componentName))) {
  +            ret = antLibCurrentTypeTable.getDefinition(componentName);
           }
           if (ret == null) {
               ret = antTypeTable.getDefinition(componentName);
  @@ -689,9 +691,11 @@
                           Project.MSG_DEBUG);
               antTypeTable.put(name, def);
   
  -            if (antLibTypeTable != null && name.lastIndexOf(':') != -1) {
  +            if (antLibCurrentTypeTable != null && name.lastIndexOf(':') != 
-1) {
                   String baseName = name.substring(name.lastIndexOf(':') + 1);
  -                antLibTypeTable.put(baseName, def);
  +                antLibCurrentTypeTable.put(
  +                    ProjectHelper.genComponentName(
  +                        ProjectHelper.ANT_CURRENT_URI, baseName), def);
               }
           }
       }
  @@ -700,8 +704,8 @@
        * Called at the start of processing an antlib
        */
       public void enterAntLib() {
  -        antLibTypeTable = new AntTypeTable(project);
  -        antLibStack.push(antLibTypeTable);
  +        antLibCurrentTypeTable = new AntTypeTable(project);
  +        antLibStack.push(antLibCurrentTypeTable);
       }
   
       /**
  @@ -710,9 +714,9 @@
       public void exitAntLib() {
           antLibStack.pop();
           if (antLibStack.size() != 0) {
  -            antLibTypeTable = (AntTypeTable) antLibStack.peek();
  +            antLibCurrentTypeTable = (AntTypeTable) antLibStack.peek();
           } else {
  -            antLibTypeTable = null;
  +            antLibCurrentTypeTable = null;
           }
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to