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

Shane Bryzak Shane_Bryzak at symantec.com
Fri Jan 26 02:15:32 EST 2007


  User: sbryzak2
  Date: 07/01/26 02:15:32

  Modified:    src/ui/org/jboss/seam/ui  UIFormattedText.java
  Log:
  fixed NPE
  
  Revision  Changes    Path
  1.2       +36 -45    jboss-seam/src/ui/org/jboss/seam/ui/UIFormattedText.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: UIFormattedText.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/ui/org/jboss/seam/ui/UIFormattedText.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- UIFormattedText.java	16 Jan 2007 20:52:45 -0000	1.1
  +++ UIFormattedText.java	26 Jan 2007 07:15:32 -0000	1.2
  @@ -1,32 +1,24 @@
   package org.jboss.seam.ui;
  -
   import java.io.IOException;
   import java.io.Reader;
   import java.io.StringReader;
  -
   import javax.faces.component.UIOutput;
   import javax.faces.context.FacesContext;
  -
   import org.jboss.seam.text.L;
   import org.jboss.seam.text.P;
  -
   import antlr.ANTLRException;
  -
   public class UIFormattedText extends UIOutput             
   {
      public static final String COMPONENT_FAMILY = "org.jboss.seam.ui.FormattedText";
  -
      @Override
      public String getFamily()
      {
         return COMPONENT_FAMILY;
      }
  -
      @Override
      public void encodeBegin(FacesContext context) throws IOException
      {
  -      if ( !isRendered() ) return;
  -
  +      if ( !isRendered() || getValue() == null) return;
         Reader r = new StringReader( (String) getValue() );
         L lexer = new L(r);
         P parser = new P(lexer);
  @@ -38,7 +30,6 @@
         {
            throw new RuntimeException(re);
         }
  -
         context.getResponseWriter().write(parser.toString());
      }
      
  
  
  



More information about the jboss-cvs-commits mailing list