maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1377423 - /maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java
Date Sun, 26 Aug 2012 11:57:12 GMT
Author: hboutemy
Date: Sun Aug 26 11:57:11 2012
New Revision: 1377423

URL: http://svn.apache.org/viewvc?rev=1377423&view=rev
Log:
use String.contains() API instead of indexOf() for better readability

Modified:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.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=1377423&r1=1377422&r2=1377423&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
Sun Aug 26 11:57:11 2012
@@ -114,18 +114,19 @@ public class ChildBlocksBuilder
 
                         if ( !link.endsWith( ".html" ) )
                         {
-                            if ( link.indexOf( "http" ) < 0 )
+                            if ( !link.contains( "http" ) )
                             {
+                                // relative path: see DOXIA-298
                                 addHTMLSuffix = true;
                             }
                         }
-                        if ( link.indexOf( "|" ) > 0 )
+                        if ( link.contains( "|" ) )
                         {
                             String[] pieces = StringUtils.split( text.toString(), "|" );
 
                             if ( addHTMLSuffix )
                             {
-                                if ( pieces[1].indexOf( "#" ) < 0 )
+                                if ( !pieces[1].contains( "#" ) )
                                 {
                                     pieces[1] = pieces[1].concat( ".html" );
                                 }
@@ -152,7 +153,7 @@ public class ChildBlocksBuilder
 
                             if ( addHTMLSuffix )
                             {
-                                if ( link.indexOf( "#" ) < 0 )
+                                if ( !link.contains( "#" ) )
                                 {
                                     link = link.concat( ".html" );
                                 }



Mime
View raw message