maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r656765 - in /maven/doxia/doxia/trunk: doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/ doxia-core/src/main/java/org/apache/maven/doxia/util/ doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/ doxi...
Date Thu, 15 May 2008 18:07:05 GMT
Author: bentmann
Date: Thu May 15 11:07:04 2008
New Revision: 656765

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

Modified:
    maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java
    maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java

Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java?rev=656765&r1=656764&r2=656765&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java
(original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java
Thu May 15 11:07:04 2008
@@ -26,6 +26,7 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 
 /** Utility class for reading snippets. */
 public class SnippetReader
@@ -173,8 +174,8 @@
      */
     protected boolean isDemarcator( String snippetId, String what, String line )
     {
-        String upper = line.toUpperCase();
-        return upper.indexOf( what.toUpperCase() ) != -1
+        String upper = line.toUpperCase( Locale.ENGLISH );
+        return upper.indexOf( what.toUpperCase( Locale.ENGLISH ) ) != -1
             && upper.indexOf( "SNIPPET" ) != -1
             && line.indexOf( snippetId ) != -1;
     }

Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java?rev=656765&r1=656764&r2=656765&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java
(original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java
Thu May 15 11:07:04 2008
@@ -20,6 +20,7 @@
  */
 
 import java.io.UnsupportedEncodingException;
+import java.util.Locale;
 
 /**
  * General Doxia utility methods. The methods in this class should not assume
@@ -57,7 +58,7 @@
      */
     public static boolean isExternalLink( String link )
     {
-        String text = link.toLowerCase();
+        String text = link.toLowerCase( Locale.ENGLISH );
 
         return ( text.indexOf( "http:/" ) == 0 || text.indexOf( "https:/" ) == 0
             || text.indexOf( "ftp:/" ) == 0 || text.indexOf( "mailto:" ) == 0

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java?rev=656765&r1=656764&r2=656765&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptUtils.java
Thu May 15 11:07:04 2008
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import java.util.Locale;
+
 /**
  * A collection of utility methods for dealing with APT documents.
  *
@@ -62,7 +64,7 @@
      */
     public static boolean isExternalLink( String link )
     {
-        String text = link.toLowerCase();
+        String text = link.toLowerCase( Locale.ENGLISH );
 
         return ( text.indexOf( "http:/" ) == 0 || text.indexOf( "https:/" ) == 0
             || text.indexOf( "ftp:/" ) == 0 || text.indexOf( "mailto:" ) == 0

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java?rev=656765&r1=656764&r2=656765&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
Thu May 15 11:07:04 2008
@@ -21,6 +21,7 @@
 
 import java.io.StringWriter;
 import java.io.Writer;
+import java.util.Locale;
 import java.util.StringTokenizer;
 
 import javax.swing.text.MutableAttributeSet;
@@ -1176,7 +1177,7 @@
     {
         if ( graphicsFileName != null )
         {
-            String format = FileUtils.extension( graphicsFileName ).toUpperCase();
+            String format = FileUtils.extension( graphicsFileName ).toUpperCase( Locale.ENGLISH
);
             if ( format.length() == 0 )
             {
                 format = "JPEG";

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java?rev=656765&r1=656764&r2=656765&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
(original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
Thu May 15 11:07:04 2008
@@ -26,6 +26,7 @@
 import java.io.Writer;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.Locale;
 
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.sink.SinkAdapter;
@@ -1139,7 +1140,7 @@
     public void figureGraphics( String name )
     {
         String urlName = null;
-        if ( ( name.toLowerCase().startsWith( "http://" ) ) || ( name.toLowerCase().startsWith(
"https://" ) ) )
+        if ( ( name.toLowerCase( Locale.ENGLISH ).startsWith( "http://" ) ) || ( name.toLowerCase(
Locale.ENGLISH ).startsWith( "https://" ) ) )
         {
             urlName = name;
         }



Mime
View raw message