maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r806521 - in /maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src: main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
Date Fri, 21 Aug 2009 12:08:07 GMT
Author: vsiveton
Date: Fri Aug 21 12:08:07 2009
New Revision: 806521

URL: http://svn.apache.org/viewvc?rev=806521&view=rev
Log:
o added a warn instead of an exception as discussed dev@

Modified:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java?rev=806521&r1=806520&r2=806521&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
Fri Aug 21 12:08:07 2009
@@ -125,13 +125,15 @@
         }
         else if ( parser.getName().equals( TITLE.toString() ) )
         {
-            if ( hasTitle )
+            if ( hasTitle && getLog().isWarnEnabled() )
             {
-                throw new XmlPullParserException( "<title/> should be defined in <properties/>
or in <head/>, "
-                    + "not both." );
+                getLog().warn( "<title/> was already defined in <properties/>,
ignored <title/> in <head/>." );
+            }
+            else
+            {
+                sink.title( attribs );
+                this.hasTitle = true;
             }
-            sink.title( attribs );
-            this.hasTitle = true;
         }
         else if ( parser.getName().equals( AUTHOR_TAG.toString() ) )
         {

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java?rev=806521&r1=806520&r2=806521&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
Fri Aug 21 12:08:07 2009
@@ -194,15 +194,8 @@
                 + "<properties><title>title</title>"
                 + "<author email=\"a@b.c\">John Doe</author></properties>"
                 + "<head><title>title</title></head><body></body></document>";
-        try
-        {
-            parser.parse( text, sink );
-            assertTrue( false );
-        }
-        catch ( ParseException e )
-        {
-            assertTrue( true );
-        }
+        parser.parse( text, sink );
+        assertTrue( true );
     }
 
     /** @throws Exception  */



Mime
View raw message