You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by dg...@apache.org on 2003/09/28 19:21:51 UTC

cvs commit: jakarta-struts/src/share/org/apache/struts/action ActionMessages.java

dgraham     2003/09/28 10:21:51

  Modified:    src/share/org/apache/struts/action ActionMessages.java
  Log:
  Simplified size() method.
  
  Revision  Changes    Path
  1.13      +12 -17    jakarta-struts/src/share/org/apache/struts/action/ActionMessages.java
  
  Index: ActionMessages.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionMessages.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ActionMessages.java	11 Sep 2003 01:18:45 -0000	1.12
  +++ ActionMessages.java	28 Sep 2003 17:21:51 -0000	1.13
  @@ -128,7 +128,7 @@
       /**
        * The current number of the property/key being added.  This is used
        * to maintain the order messages are added.
  -    */
  +     */
       protected int iCount = 0;
   
       // --------------------------------------------------------- Public Methods
  @@ -327,32 +327,27 @@
        *
        * @param property Property name (or ActionMessages.GLOBAL_MESSAGE)
        */
  -    public int size(String property) {
  -
  -        ActionMessageItem ami = (ActionMessageItem) messages.get(property);
  +	public int size(String property) {
   
  -        if (ami == null) {
  -            return (0);
  -        } else {
  -            return (ami.getList().size());
  -        }
  +		ActionMessageItem item = (ActionMessageItem) messages.get(property);
   
  -    }
  +		return (item == null) ? 0 : item.getList().size();
  +	}
   
       /**
        * This class is used to store a set of messages associated with a
        * property/key and the position it was initially added to list.
  -    */
  +     */
       protected class ActionMessageItem implements Serializable {
   
           /**
            * The list of <code>ActionMessage</code>s.
  -        */
  +         */
           protected List list = null;
   
           /**
            * The position in the list of messages.
  -        */
  +         */
           protected int iOrder = 0;
   
           public ActionMessageItem(List list, int iOrder) {
  
  
  

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