maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r772532 - in /maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src: main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java
Date Thu, 07 May 2009 07:33:28 GMT
Author: ltheussl
Date: Thu May  7 07:33:26 2009
New Revision: 772532

URL: http://svn.apache.org/viewvc?rev=772532&view=rev
Log:
Formatting

Modified:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java?rev=772532&r1=772531&r2=772532&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java
Thu May  7 07:33:26 2009
@@ -109,22 +109,31 @@
                 case ']':
                     if ( insideLink )
                     {
-                    	boolean addHTMLSuffix = false;
+                        boolean addHTMLSuffix = false;
                         String link = text.toString();
 
-                        if (!link.endsWith(".html"))
-                        	if (!link.contains("http"))
-                        			addHTMLSuffix = true;
+                        if ( !link.endsWith( ".html" ) )
+                        {
+                            if ( !link.contains( "http" ) )
+                            {
+                                addHTMLSuffix = true;
+                            }
+                        }
                         if ( link.indexOf( "|" ) > 0 )
                         {
                             String[] pieces = StringUtils.split( text.toString(), "|" );
-                            if (addHTMLSuffix) {
-                                if (!pieces[1].contains("#"))
-                                    pieces[1] = pieces[1].concat(".html");
-                                else {
-                                    if (!pieces[1].startsWith("#"))
+
+                            if ( addHTMLSuffix )
+                            {
+                                if ( !pieces[1].contains( "#" ) )
+                                {
+                                    pieces[1] = pieces[1].concat( ".html" );
+                                }
+                                else
+                                {
+                                    if ( !pieces[1].startsWith( "#" ) )
                                     {
-                                        String[] temp = pieces[1].split("#");
+                                        String[] temp = pieces[1].split( "#" );
                                         pieces[1] = temp[0] + ".html#" + temp[1];
                                     }
                                 }
@@ -136,22 +145,27 @@
                         {
                             String value = link;
 
-                            if ( link.startsWith( "#" ) )
+                            if ( link.startsWith( "#"              ) )
                             {
                                 value = link.substring( 1 );
                             }
 
-                            if (addHTMLSuffix) {
-                                if (!link.contains("#"))
-                                    link = link.concat(".html");
-                                else {
-                                    if (!link.startsWith("#"))
+                            if ( addHTMLSuffix )
+                            {
+                                if ( !link.contains( "#" ) )
+                                {
+                                    link = link.concat( ".html" );
+                                }
+                                else
+                                {
+                                    if ( !link.startsWith( "#" ) )
                                     {
-                                        String[] temp = link.split("#");
+                                        String[] temp = link.split( "#" );
                                         link = temp[0] + ".html#" + temp[1];
                                     }
                                 }
                             }
+
                             blocks.add( new LinkBlock( link, value ) );
                         }
 

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java?rev=772532&r1=772531&r2=772532&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java
Thu May  7 07:33:26 2009
@@ -133,8 +133,8 @@
 
         for ( int i = 1; i <= 5; i++ )
         {
-            assertContainsLines( "Could not locate section " + i + " title", result, "sectionTitle"
+ i +
-                "\ntext: Section" + i );
+            assertContainsLines( "Could not locate section " + i + " title", result,
+                    "sectionTitle" + i + "\ntext: Section" + i );
         }
 
         assertContainsLines( "Section title has leading space", result, "sectionTitle1\ntext:
TitleWithLeadingSpace" );
@@ -146,7 +146,8 @@
     {
         String result = locateAndParseTestSourceFile( "nested-list" );
 
-        assertContainsLines( "Nested list not found", result, "begin:listItem\ntext: A top
level list item\nbegin:list" );
+        assertContainsLines( "Nested list not found", result,
+                "begin:listItem\ntext: A top level list item\nbegin:list" );
         // two lists in the input...
         assertEquals( 3, result.split( "end:list\n" ).length );
         // ...and 4 list items
@@ -340,7 +341,7 @@
     /**
      * DOXIA-247
      *
-     * @throws ParseException
+     * @throws ParseException if something goes wrong.
      */
     public void testEndBracket()
         throws ParseException



Mime
View raw message