commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-commons/digester/src/java/org/apache/commons/digester Digester.java ObjectCreateRule.java
Date Sat, 05 Jan 2002 19:48:40 GMT
craigmcc    02/01/05 11:48:40

  Modified:    digester/src/java/org/apache/commons/digester Digester.java
                        ObjectCreateRule.java
  Log:
  Reverse the order of the second and third arguments in the new object create
  rule that was added (String/Class/String --> String/String/Class).  Doing
  things the other way broke a *bunch* of code using Digester like this:
  
    digester.addObjectCreate("pattern", null, "class.name");
  
  because it made the "null" second argument ambiguous.
  
  Aren't we all glad we have Gump to catch this kind of thing for us?
  
  Revision  Changes    Path
  1.34      +9 -8      jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java
  
  Index: Digester.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- Digester.java	5 Jan 2002 19:29:08 -0000	1.33
  +++ Digester.java	5 Jan 2002 19:48:39 -0000	1.34
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v
1.33 2002/01/05 19:29:08 craigmcc Exp $
  - * $Revision: 1.33 $
  - * $Date: 2002/01/05 19:29:08 $
  + * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v
1.34 2002/01/05 19:48:39 craigmcc Exp $
  + * $Revision: 1.34 $
  + * $Date: 2002/01/05 19:48:39 $
    *
    * ====================================================================
    *
  @@ -112,7 +112,7 @@
    *
    * @author Craig McClanahan
    * @author Scott Sanders
  - * @version $Revision: 1.33 $ $Date: 2002/01/05 19:29:08 $
  + * @version $Revision: 1.34 $ $Date: 2002/01/05 19:48:39 $
    */
   
   public class Digester extends DefaultHandler {
  @@ -1589,15 +1589,16 @@
        * Add an "object create" rule for the specified parameters.
        *
        * @param pattern Element matching pattern
  -     * @param clazz Default Java class to be created
        * @param attributeName Attribute name that optionally overrides
  +     * @param clazz Default Java class to be created
        *  the default Java class name to be created
        */
  -    public void addObjectCreate(String pattern, Class clazz,
  -                                String attributeName) {
  +    public void addObjectCreate(String pattern,
  +                                String attributeName,
  +                                Class clazz) {
   
           addRule(pattern,
  -                new ObjectCreateRule(this, clazz, attributeName));
  +                new ObjectCreateRule(this, attributeName, clazz));
   
       }
   
  
  
  
  1.9       +10 -9     jakarta-commons/digester/src/java/org/apache/commons/digester/ObjectCreateRule.java
  
  Index: ObjectCreateRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/ObjectCreateRule.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ObjectCreateRule.java	4 Jan 2002 05:32:11 -0000	1.8
  +++ ObjectCreateRule.java	5 Jan 2002 19:48:39 -0000	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/ObjectCreateRule.java,v
1.8 2002/01/04 05:32:11 sanders Exp $
  - * $Revision: 1.8 $
  - * $Date: 2002/01/04 05:32:11 $
  + * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/ObjectCreateRule.java,v
1.9 2002/01/05 19:48:39 craigmcc Exp $
  + * $Revision: 1.9 $
  + * $Date: 2002/01/05 19:48:39 $
    *
    * ====================================================================
    *
  @@ -73,7 +73,7 @@
    *
    * @author Craig McClanahan
    * @author Scott Sanders
  - * @version $Revision: 1.8 $ $Date: 2002/01/04 05:32:11 $
  + * @version $Revision: 1.9 $ $Date: 2002/01/05 19:48:39 $
    */
   
   public class ObjectCreateRule extends Rule {
  @@ -90,7 +90,7 @@
        */
       public ObjectCreateRule(Digester digester, String className) {
   
  -        this(digester, className, null);
  +        this(digester, className, (String) null);
   
       }
   
  @@ -103,7 +103,7 @@
        */
       public ObjectCreateRule(Digester digester, Class clazz) {
   
  -        this(digester, clazz.getName(), null);
  +        this(digester, clazz.getName(), (String) null);
   
       }
   
  @@ -132,12 +132,13 @@
        * optional attribute name containing an override.
        *
        * @param digester The associated Digester
  -     * @param clazz Java class name of the object to be created
        * @param attributeName Attribute name which, if present, contains an
  +     * @param clazz Java class name of the object to be created
        *  override of the class name to create
        */
  -    public ObjectCreateRule(Digester digester, Class clazz,
  -                            String attributeName) {
  +    public ObjectCreateRule(Digester digester,
  +                            String attributeName,
  +                            Class clazz) {
   
           this(digester, clazz.getName(), attributeName);
   
  
  
  

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


Mime
View raw message