maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r656753 - in /maven/doxia/doxia-tools/trunk: doxia-converter/src/main/java/org/apache/maven/doxia/ doxia-converter/src/main/java/org/apache/maven/doxia/util/ doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/ doxia-linkcheck/sr...
Date Thu, 15 May 2008 17:35:28 GMT
Author: bentmann
Date: Thu May 15 10:35:27 2008
New Revision: 656753

URL: http://svn.apache.org/viewvc?rev=656753&view=rev
Log:
o Fixed case-insensitive string handling

Modified:
    maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/DefaultConverter.java
    maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/util/FormatUtils.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/DefaultLinkCheck.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkMatcher.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/FileLinkValidator.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/HTTPLinkValidator.java
    maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java

Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/DefaultConverter.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/DefaultConverter.java?rev=656753&r1=656752&r2=656753&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/DefaultConverter.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/DefaultConverter.java
Thu May 15 10:35:27 2008
@@ -28,6 +28,7 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import org.apache.commons.lang.ClassUtils;
@@ -313,7 +314,7 @@
      */
     private static String getParserFormat( Class clazz )
     {
-        return StringUtils.replace( ClassUtils.getShortClassName( clazz ).toLowerCase(),
"parser", "" );
+        return StringUtils.replace( ClassUtils.getShortClassName( clazz ).toLowerCase( Locale.ENGLISH
), "parser", "" );
     }
 
     /**
@@ -323,7 +324,7 @@
      */
     private static String getSinkFormat( Class clazz )
     {
-        return StringUtils.replace( ClassUtils.getShortClassName( clazz ).toLowerCase(),
"sink", "" );
+        return StringUtils.replace( ClassUtils.getShortClassName( clazz ).toLowerCase( Locale.ENGLISH
), "sink", "" );
     }
 
     /**

Modified: maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/util/FormatUtils.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/util/FormatUtils.java?rev=656753&r1=656752&r2=656753&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/util/FormatUtils.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-converter/src/main/java/org/apache/maven/doxia/util/FormatUtils.java
Thu May 15 10:35:27 2008
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import java.util.Locale;
+
 import org.apache.maven.doxia.UnsupportedFormatException;
 import org.codehaus.plexus.util.SelectorUtils;
 import org.codehaus.plexus.util.StringUtils;
@@ -53,12 +55,12 @@
 
         String fromFormat = from;
         String supportedString = StringUtils.join( supportedFormat, ", " );
-        if ( supportedString.indexOf( fromFormat.toLowerCase() ) == -1 )
+        if ( supportedString.indexOf( fromFormat.toLowerCase( Locale.ENGLISH ) ) == -1 )
         {
             throw new UnsupportedFormatException( fromFormat, supportedFormat );
         }
 
-        return fromFormat.toLowerCase();
+        return fromFormat.toLowerCase( Locale.ENGLISH );
     }
 
     /**
@@ -101,11 +103,11 @@
         }
 
         String supportedString = StringUtils.join( supportedFormat, ", " );
-        if ( supportedString.indexOf( fromFormat.toLowerCase() ) == -1 )
+        if ( supportedString.indexOf( fromFormat.toLowerCase( Locale.ENGLISH ) ) == -1 )
         {
             throw new UnsupportedFormatException( fromFormat, supportedFormat );
         }
 
-        return fromFormat.toLowerCase();
+        return fromFormat.toLowerCase( Locale.ENGLISH );
     }
 }

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/DefaultLinkCheck.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/DefaultLinkCheck.java?rev=656753&r1=656752&r2=656753&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/DefaultLinkCheck.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/DefaultLinkCheck.java
Thu May 15 10:35:27 2008
@@ -26,6 +26,7 @@
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.LinkedList;
+import java.util.Locale;
 import java.util.Set;
 
 import org.apache.commons.logging.Log;
@@ -675,7 +676,7 @@
                 return true;
             }
 
-            if ( name.toLowerCase().endsWith( ".html" ) || name.toLowerCase().endsWith( ".htm"
) )
+            if ( name.toLowerCase( Locale.ENGLISH ).endsWith( ".html" ) || name.toLowerCase(
Locale.ENGLISH ).endsWith( ".htm" ) )
             {
                 return true;
             }

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkMatcher.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkMatcher.java?rev=656753&r1=656752&r2=656753&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkMatcher.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/LinkMatcher.java
Thu May 15 10:35:27 2008
@@ -23,6 +23,7 @@
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
+import java.util.Locale;
 import java.util.Set;
 import java.util.TreeSet;
 import java.util.regex.Matcher;
@@ -111,11 +112,12 @@
             {
                 continue;
             }
-            else if ( link.toLowerCase().indexOf( "javascript" ) != -1 )
+            else if ( link.toLowerCase( Locale.ENGLISH ).indexOf( "javascript" ) != -1 )
             {
                 continue;
             }
-            // else if (link.toLowerCase().indexOf("mailto:") != -1) {
+            // TODO: Review dead code and delete if not needed
+            // else if (link.toLowerCase( Locale.ENGLISH ).indexOf("mailto:") != -1) {
             // continue;
             // }
 

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/FileLinkValidator.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/FileLinkValidator.java?rev=656753&r1=656752&r2=656753&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/FileLinkValidator.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/FileLinkValidator.java
Thu May 15 10:35:27 2008
@@ -20,6 +20,7 @@
  */
 
 import java.io.File;
+import java.util.Locale;
 
 import org.apache.maven.doxia.linkcheck.model.LinkcheckFileResult;
 
@@ -52,7 +53,7 @@
 
         // If we find an http(s) link or a mail link, it's not good
         // links starting with "/" should have a base URL pre-pended and be handled by OnlineHTTPLinkValidator.
-        if ( link.toLowerCase().startsWith( "http://" ) || link.toLowerCase().startsWith(
"https://" )
+        if ( link.toLowerCase( Locale.ENGLISH ).startsWith( "http://" ) || link.toLowerCase(
Locale.ENGLISH ).startsWith( "https://" )
             || link.indexOf( '@' ) != -1 || link.startsWith( "/" ) )
         {
             return null;

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/HTTPLinkValidator.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/HTTPLinkValidator.java?rev=656753&r1=656752&r2=656753&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/HTTPLinkValidator.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/HTTPLinkValidator.java
Thu May 15 10:35:27 2008
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import java.util.Locale;
+
 /**
  * Checks links which are normal URLs.
  *
@@ -33,7 +35,7 @@
     {
         String link = lvi.getLink();
 
-        if ( !link.toLowerCase().startsWith( "http://" ) && !link.toLowerCase().startsWith(
"https://" )
+        if ( !link.toLowerCase( Locale.ENGLISH ).startsWith( "http://" ) && !link.toLowerCase(
Locale.ENGLISH ).startsWith( "https://" )
             && !link.startsWith( "/" ) )
         {
             return null;

Modified: maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java?rev=656753&r1=656752&r2=656753&view=diff
==============================================================================
--- maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java
(original)
+++ maven/doxia/doxia-tools/trunk/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java
Thu May 15 10:35:27 2008
@@ -299,11 +299,11 @@
 
         HttpMethod hm;
 
-        if ( HEAD_METHOD.equals( this.http.getMethod().toLowerCase() ) )
+        if ( HEAD_METHOD.equalsIgnoreCase( this.http.getMethod() ) )
         {
             hm = new HeadMethod( link );
         }
-        else if ( GET_METHOD.equals( this.http.getMethod().toLowerCase() ) )
+        else if ( GET_METHOD.equalsIgnoreCase( this.http.getMethod() ) )
         {
             hm = new GetMethod( link );
         }



Mime
View raw message