[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/dao ...
Christian Bauer
christian at hibernate.org
Wed Sep 26 05:36:18 EDT 2007
User: cbauer
Date: 07/09/26 05:36:18
Modified: examples/wiki/src/main/org/jboss/seam/wiki/core/dao
FeedDAO.java
Log:
New handling for Seam Text errors, no more STDERR garbage
Revision Changes Path
1.19 +14 -1 jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/FeedDAO.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FeedDAO.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/dao/FeedDAO.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- FeedDAO.java 25 Sep 2007 14:30:44 -0000 1.18
+++ FeedDAO.java 26 Sep 2007 09:36:18 -0000 1.19
@@ -13,6 +13,7 @@
import org.jboss.seam.wiki.core.engine.WikiLink;
import org.jboss.seam.wiki.core.engine.WikiLinkResolver;
import org.jboss.seam.wiki.core.action.prefs.WikiPreferences;
+import org.jboss.seam.wiki.core.ui.SeamTextValidator;
import org.jboss.seam.wiki.util.WikiUtil;
import org.jboss.seam.Component;
import org.jboss.seam.log.Log;
@@ -22,6 +23,9 @@
import javax.persistence.NoResultException;
import java.util.*;
+import antlr.RecognitionException;
+import antlr.ANTLRException;
+
/**
* DAO for feeds.
* <p>
@@ -224,7 +228,16 @@
);
// Run the parser
+ try {
parser.parse(true);
+
+ } catch (RecognitionException rex) {
+ // Swallow and log and low debug level
+ log.debug( "Ignored parse error generating feed entry text: " + SeamTextValidator.getErrorMessage(wikiText, rex) );
+ } catch (ANTLRException ex) {
+ // All other errors are fatal;
+ throw new RuntimeException(ex);
+ }
return parser.toString();
}
More information about the jboss-cvs-commits
mailing list