[jboss-cvs] jboss-seam/src/ui/org/jboss/seam/ui ...

Norman Richards norman.richards at jboss.com
Sun Mar 4 03:49:00 EST 2007


  User: nrichards
  Date: 07/03/04 03:48:59

  Modified:    src/ui/org/jboss/seam/ui  UISelectDate.java
  Log:
  fix null pointer when day names are too short
  
  Revision  Changes    Path
  1.2       +8 -1      jboss-seam/src/ui/org/jboss/seam/ui/UISelectDate.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: UISelectDate.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/ui/org/jboss/seam/ui/UISelectDate.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- UISelectDate.java	27 Feb 2007 00:46:48 -0000	1.1
  +++ UISelectDate.java	4 Mar 2007 08:48:59 -0000	1.2
  @@ -138,10 +138,17 @@
             if (!"".equals(val))
             {
                if (sb.length() > 0) sb.append(',');
  -             sb.append(maxLength == -1 ? val : val.substring(0, maxLength));
  +             sb.append(limitLength(val,maxLength));
             }
          }
          return sb.toString();
       }
                           
  +    private String limitLength(String source, int maxLength) {
  +        if (maxLength < 0 || maxLength > source.length()) {
  +            return source;
  +        } else {
  +            return source.substring(0,maxLength);
  +        }        
  +    }
   }
  
  
  



More information about the jboss-cvs-commits mailing list