Update of /cvsroot/xdoclet/xdoclet/core/src/xdoclet/tagshandler
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8597/src/xdoclet/tagshandler

Modified Files:
        ClassTagsHandler.java 
Log Message:
Fix bug in which forAllClassTags() method loses context in nested merged files 
where a parent and child merge file both use forAllClassTags()

Index: ClassTagsHandler.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet/core/src/xdoclet/tagshandler/ClassTagsHandler.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** ClassTagsHandler.java       9 Jun 2005 11:22:53 -0000       1.26
--- ClassTagsHandler.java       26 Jul 2005 21:02:38 -0000      1.27
***************
*** 15,18 ****
--- 15,19 ----
  import java.util.StringTokenizer;
  
+ import org.apache.commons.collections.ArrayStack;
  import org.apache.commons.logging.Log;
  
***************
*** 42,45 ****
--- 43,48 ----
      protected final static Calendar now = Calendar.getInstance();
  
+     private final static ArrayStack classTagStack = new ArrayStack();
+ 
      /**
       * Returns the not-full-qualified name of the specified class without the 
package name.
***************
*** 668,671 ****
--- 671,681 ----
      public void forAllClassTags(String template, Properties attributes) 
throws XDocletException
      {
+         Log log = LogUtil.getLog(ClassTagsHandler.class, "forAllClassTags");
+         XTag currentTag = getCurrentClassTag();
+ 
+         log.debug("pushing [" + currentTag + "] on to class tag stack");
+         if (currentTag != null)
+             classTagStack.push(currentTag);
+         try {
          boolean superclasses = 
TypeConversionUtil.stringToBoolean(attributes.getProperty("superclasses"), 
true);
          Collection tags = 
getCurrentClass().getDoc().getTags(attributes.getProperty("tagName"), 
superclasses);
***************
*** 692,696 ****
              generate(template);
          }
!         setCurrentClassTag(null);
          matchPattern = null;
      }
--- 702,713 ----
              generate(template);
          }
!         } finally {
!         if (classTagStack.size() == 0)
!             currentTag = null;
!         else
!             currentTag = (XTag) classTagStack.pop();
!         }
!         log.debug("popped [" + currentTag + "] off of class tag stack");
!         setCurrentClassTag(currentTag);
          matchPattern = null;
      }



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to