[jboss-cvs] jboss-seam/ui/src/main/java/org/jboss/seam/ui/component ...

Christian Bauer christian at hibernate.org
Wed Sep 26 05:31:52 EDT 2007


  User: cbauer  
  Date: 07/09/26 05:31:52

  Modified:    ui/src/main/java/org/jboss/seam/ui/component 
                        UIFormattedText.java
  Log:
  Disabled default ANTLR parser error handler and log errors in UIFormattedText
  
  Revision  Changes    Path
  1.2       +11 -3     jboss-seam/ui/src/main/java/org/jboss/seam/ui/component/UIFormattedText.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: UIFormattedText.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/ui/src/main/java/org/jboss/seam/ui/component/UIFormattedText.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- UIFormattedText.java	15 Jun 2007 17:06:57 -0000	1.1
  +++ UIFormattedText.java	26 Sep 2007 09:31:51 -0000	1.2
  @@ -28,8 +28,11 @@
   
   import org.jboss.seam.text.SeamTextLexer;
   import org.jboss.seam.text.SeamTextParser;
  +import org.jboss.seam.log.Logging;
  +import org.jboss.seam.log.Log;
   
   import antlr.ANTLRException;
  +import antlr.RecognitionException;
   
   /**
    * JSF component class
  @@ -37,6 +40,8 @@
    */
   public abstract class UIFormattedText extends UIOutput {
   	
  +   Log log = Logging.getLog(UIFormattedText.class);
  +
   	@SuppressWarnings("unused")
      private static final String COMPONENT_TYPE = "org.jboss.seam.ui.FormattedText";
   	
  @@ -53,9 +58,12 @@
         {
            parser.startRule();
         }
  -      catch (ANTLRException re)
  -      {
  -         throw new RuntimeException(re);
  +      catch (RecognitionException rex) {
  +          // Log a nice message for any lexer/parser errors, users can disable this if they want to
  +          log.warn( "Seam Text parse error: " + rex.getMessage() );
  +      } catch (ANTLRException ex) {
  +          // All other errors are fatal;
  +          throw new RuntimeException(ex);
         }
         return parser.toString();
      }
  
  
  



More information about the jboss-cvs-commits mailing list