commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject cvs commit: jakarta-commons/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing ComponentTag.java
Date Wed, 12 Jan 2005 08:59:16 GMT
polx        2005/01/12 00:59:16

  Modified:    jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing
                        ComponentTag.java
  Log:
  Slightly better tolerance for null component when invoking toString().
  paul
  
  Revision  Changes    Path
  1.23      +3 -2      jakarta-commons/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ComponentTag.java
  
  Index: ComponentTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ComponentTag.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- ComponentTag.java	12 Sep 2004 15:34:32 -0000	1.22
  +++ ComponentTag.java	12 Jan 2005 08:59:16 -0000	1.23
  @@ -83,8 +83,9 @@
       }
   
       public String toString() {
  -        String componentName = getComponent().getName();
  -        if (componentName == null || componentName.length() == 0)
  +		Component comp = getComponent();
  +        String componentName = (comp!=null) ? comp.getName() : null;
  +        if (comp!=null && (componentName == null || componentName.length() == 0))
               componentName = getComponent().toString();
           return "ComponentTag with bean " + componentName;
       }
  
  
  

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


Mime
View raw message