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 SetPropertiesRule.java
Date Sat, 16 Aug 2003 18:02:56 GMT
craigmcc    2003/08/16 11:02:56

  Modified:    digester/src/java/org/apache/commons/digester
                        SetPropertiesRule.java
  Log:
  Avoid an NPE when debugging is enabled and there is no "top" object
  on the Digester stack.
  
  PR:  Bugzilla #22131
  Reported By:  r1akhil at ibm.com
  
  Revision  Changes    Path
  1.12      +12 -6     jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertiesRule.java
  
  Index: SetPropertiesRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertiesRule.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SetPropertiesRule.java	16 Apr 2003 11:23:50 -0000	1.11
  +++ SetPropertiesRule.java	16 Aug 2003 18:02:56 -0000	1.12
  @@ -253,8 +253,14 @@
           // Populate the corresponding properties of the top object
           Object top = digester.peek();
           if (digester.log.isDebugEnabled()) {
  -            digester.log.debug("[SetPropertiesRule]{" + digester.match +
  -                    "} Set " + top.getClass().getName() + " properties");
  +            if (top != null) {
  +                digester.log.debug("[SetPropertiesRule]{" + digester.match +
  +                                   "} Set " + top.getClass().getName() +
  +                                   " properties");
  +            } else {
  +                digester.log.debug("[SetPropertiesRule]{" + digester.match +
  +                                   "} Set NULL properties");
  +            }
           }
           BeanUtils.populate(top, values);
   
  
  
  

Mime
View raw message