You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rd...@apache.org on 2003/10/28 23:31:02 UTC

cvs commit: jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules DigesterRuleParser.java

rdonkin     2003/10/28 14:31:02

  Modified:    digester/src/java/org/apache/commons/digester/xmlrules
                        DigesterRuleParser.java
  Log:
  This is an adapted version of the contributed patch. It should ensure that the current behaviour is preserved (allowing rules to be added that begin with a slash) whilst also ensure that the documented behaviour is also allowed. Original patch contributed by Henning P. Schmiedehausen.
  
  Revision  Changes    Path
  1.21      +10 -4     jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/DigesterRuleParser.java
  
  Index: DigesterRuleParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/DigesterRuleParser.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- DigesterRuleParser.java	23 Oct 2003 20:06:09 -0000	1.20
  +++ DigesterRuleParser.java	28 Oct 2003 22:31:02 -0000	1.21
  @@ -456,7 +456,13 @@
            * by concatenating the pattern prefix with the given pattern.
            */
           public void add(String pattern, Rule rule) {
  -            delegate.add(prefix + pattern, rule);
  +            StringBuffer buffer = new StringBuffer();
  +            buffer.append(prefix);
  +            if (!pattern.startsWith("/")) {
  +                buffer.append('/'); 
  +            }
  +            buffer.append(pattern);
  +            delegate.add(buffer.toString(), rule);
           }
           
           /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org