You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2021/02/06 13:08:22 UTC

[maven-jxr] branch vel created (now 5e2f7a7)

This is an automated email from the ASF dual-hosted git repository.

elharo pushed a change to branch vel
in repository https://gitbox.apache.org/repos/asf/maven-jxr.git.


      at 5e2f7a7  use lcoales for string comparison

This branch includes the following new commits:

     new 5e2f7a7  use lcoales for string comparison

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-jxr] 01/01: use lcoales for string comparison

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch vel
in repository https://gitbox.apache.org/repos/asf/maven-jxr.git

commit 5e2f7a7104c0be7c60f583a908a076891d31593c
Author: Elliotte Rusty Harold <el...@google.com>
AuthorDate: Sat Feb 6 08:08:11 2021 -0500

    use lcoales for string comparison
---
 .../org/apache/maven/plugin/jxr/JxrReport.java     |  8 +++----
 .../org/apache/maven/plugin/jxr/JxrTestReport.java |  6 ++---
 .../org/apache/maven/plugin/jxr/JxrReportTest.java | 27 +++++++++++-----------
 3 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java
index 6d5ed92..5d3997f 100644
--- a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java
+++ b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrReport.java
@@ -88,14 +88,14 @@ public class JxrReport
 
         List<String> l = new ArrayList<>();
 
-        if ( !"pom".equals( getProject().getPackaging().toLowerCase() ) )
+        if ( !"pom".equals( getProject().getPackaging().toLowerCase( Locale.US ) ) )
         {
             l.addAll( sourceDirs );
         }
 
         if ( getProject().getExecutionProject() != null )
         {
-            if ( !"pom".equals( getProject().getExecutionProject().getPackaging().toLowerCase() ) )
+            if ( !"pom".equals( getProject().getExecutionProject().getPackaging().toLowerCase( Locale.US ) ) )
             {
                 l.addAll( getProject().getExecutionProject().getCompileSourceRoots() );
             }
@@ -109,14 +109,14 @@ public class JxrReport
     {
         List<String> l = new ArrayList<>();
 
-        if ( !"pom".equals( project.getPackaging().toLowerCase() ) )
+        if ( !"pom".equals( project.getPackaging().toLowerCase( Locale.US ) ) )
         {
             l.addAll( project.getCompileSourceRoots() );
         }
 
         if ( project.getExecutionProject() != null )
         {
-            if ( !"pom".equals( project.getExecutionProject().getPackaging().toLowerCase() ) )
+            if ( !"pom".equals( project.getExecutionProject().getPackaging().toLowerCase( Locale.US ) ) )
             {
                 l.addAll( project.getExecutionProject().getCompileSourceRoots() );
             }
diff --git a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrTestReport.java b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrTestReport.java
index 062d2e9..a6c502e 100644
--- a/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrTestReport.java
+++ b/maven-jxr-plugin/src/main/java/org/apache/maven/plugin/jxr/JxrTestReport.java
@@ -66,14 +66,14 @@ public class JxrTestReport
     {
         List<String> l = new ArrayList<String>();
 
-        if ( !"pom".equals( getProject().getPackaging().toLowerCase() ) )
+        if ( !"pom".equals( getProject().getPackaging().toLowerCase( Locale.US ) ) )
         {
             l.addAll( sourceDirs );
         }
 
         if ( getProject().getExecutionProject() != null )
         {
-            if ( !"pom".equals( getProject().getExecutionProject().getPackaging().toLowerCase() ) )
+            if ( !"pom".equals( getProject().getExecutionProject().getPackaging().toLowerCase( Locale.US ) ) )
             {
                 l.addAll( getProject().getExecutionProject().getTestCompileSourceRoots() );
             }
@@ -89,7 +89,7 @@ public class JxrTestReport
 
         if ( project.getExecutionProject() != null )
         {
-            if ( !"pom".equals( project.getExecutionProject().getPackaging().toLowerCase() ) )
+            if ( !"pom".equals( project.getExecutionProject().getPackaging().toLowerCase( Locale.US ) ) )
             {
                 l.addAll( project.getExecutionProject().getTestCompileSourceRoots() );
             }
diff --git a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportTest.java b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportTest.java
index f8797bd..159901f 100644
--- a/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportTest.java
+++ b/maven-jxr-plugin/src/test/java/org/apache/maven/plugin/jxr/JxrReportTest.java
@@ -26,6 +26,7 @@ import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
+import java.util.Locale;
 
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
@@ -66,7 +67,7 @@ public class JxrReportTest
 
         //check if there's a link to the javadoc files
         String str = readFile( new File( xrefDir, "def/configuration/AppSample.html" ) );
-        assertTrue( str.toLowerCase().indexOf( "/apidocs/def/configuration/AppSample.html\"".toLowerCase() ) != -1 );
+        assertTrue( str.toLowerCase().indexOf( "/apidocs/def/configuration/appsample.html\"" ) != -1 );
 
         str = readFile( new File( xrefDir, "def/configuration/App.html" ) );
         assertTrue( str.toLowerCase().indexOf( "/apidocs/def/configuration/app.html\"".toLowerCase() ) != -1 );
@@ -107,10 +108,10 @@ public class JxrReportTest
 
         //check if there's a link to the javadoc files
         String str = readFile( new File( xrefDir, "def/configuration/AppSample.html" ) );
-        assertTrue( str.toLowerCase().indexOf( "/apidocs/def/configuration/AppSample.html\"".toLowerCase() ) != -1 );
+        assertTrue( str.toLowerCase().indexOf( "/apidocs/def/configuration/appsample.html\"" ) != -1 );
 
         str = readFile( new File( xrefDir, "def/configuration/App.html" ) );
-        assertTrue( str.toLowerCase().indexOf( "/apidocs/def/configuration/app.html\"".toLowerCase() ) != -1 );
+        assertTrue( str.toLowerCase( Locale.US ).indexOf( "/apidocs/def/configuration/app.html\"" ) != -1 );
 
         // check if encoding is UTF-8, the default value
         assertTrue( str.indexOf( "text/html; charset=UTF-8" ) != -1 );
@@ -148,10 +149,10 @@ public class JxrReportTest
 
         //check if there's a link to the javadoc files
         String str = readFile( new File( xrefDir, "def/configuration/AppSample.html" ) );
-        assertTrue( str.toLowerCase().indexOf( "/apidocs/def/configuration/AppSample.html\"".toLowerCase() ) != -1 );
+        assertTrue( str.toLowerCase( Locale.US ).indexOf( "/apidocs/def/configuration/appsample.html\"" ) != -1 );
 
         str = readFile( new File( xrefDir, "def/configuration/App.html" ) );
-        assertTrue( str.toLowerCase().indexOf( "/apidocs/def/configuration/app.html\"".toLowerCase() ) != -1 );
+        assertTrue( str.toLowerCase( Locale.US ).indexOf( "/apidocs/def/configuration/app.html\"" ) != -1 );
 
         // check if encoding is UTF-8, the default value
         assertTrue( str.indexOf( "text/html; charset=UTF-8" ) != -1 );
@@ -193,10 +194,10 @@ public class JxrReportTest
 
         //check if there's a link to the javadoc files
         String str = readFile( new File( xrefDir, "def/configuration/AppSample.html" ) );
-        assertTrue( str.toLowerCase().indexOf( "/apidocs/def/configuration/AppSample.html\"".toLowerCase() ) != -1 );
+        assertTrue( str.toLowerCase( Locale.US ).indexOf( "/apidocs/def/configuration/appsample.html\"" ) != -1 );
 
         str = readFile( new File( xrefDir, "def/configuration/App.html" ) );
-        assertTrue( str.toLowerCase().indexOf( "/apidocs/def/configuration/app.html\"".toLowerCase() ) != -1 );
+        assertTrue( str.toLowerCase( Locale.US ).indexOf( "/apidocs/def/configuration/app.html\"" ) != -1 );
 
         // check if encoding is UTF-8, the default value
         assertTrue( str.indexOf( "text/html; charset=UTF-8" ) != -1 );
@@ -234,7 +235,7 @@ public class JxrReportTest
 
         //check if there's a link to the javadoc files
         String str = readFile( new File( xrefDir, "def/configuration/AppSample.html" ) );
-        assertTrue( str.toLowerCase().indexOf( "/apidocs/def/configuration/AppSample.html\"".toLowerCase() ) != -1 );
+        assertTrue( str.toLowerCase().indexOf( "/apidocs/def/configuration/appsample.html\"" ) != -1 );
 
         str = readFile( new File( xrefDir, "def/configuration/App.html" ) );
         assertTrue( str.toLowerCase().indexOf( "/apidocs/def/configuration/app.html\"".toLowerCase() ) != -1 );
@@ -275,15 +276,15 @@ public class JxrReportTest
         //check if there's a link to the javadoc files
         String str = readFile( new File( xrefDir, "nojavadoclink/configuration/AppSample.html" ) );
         assertTrue(
-            str.toLowerCase().indexOf( "/apidocs/nojavadoclink/configuration/AppSample.html\"".toLowerCase() ) == -1 );
+            str.toLowerCase( Locale.US ).indexOf( "/apidocs/nojavadoclink/configuration/appsample.html\"" ) == -1 );
 
         str = readFile( new File( xrefDir, "nojavadoclink/configuration/App.html" ) );
         assertTrue(
-            str.toLowerCase().indexOf( "/apidocs/nojavadoclink/configuration/app.html\"".toLowerCase() ) == -1 );
+            str.toLowerCase( Locale.US ).indexOf( "/apidocs/nojavadoclink/configuration/app.html\"" ) == -1 );
 
         str = readFile( new File( xrefDir, "nojavadoclink/configuration/sample/Sample.html" ) );
         assertTrue( str.toLowerCase().indexOf(
-            "/apidocs/nojavadoclink/configuration/sample/sample.html\"".toLowerCase() ) == -1 );
+            "/apidocs/nojavadoclink/configuration/sample/sample.html\"" ) == -1 );
 
         // check if encoding is ISO-8859-1, like specified in the plugin configuration
         assertTrue( str.indexOf( "text/html; charset=ISO-8859-1" ) != -1 );
@@ -335,10 +336,10 @@ public class JxrReportTest
 
     	//check if there's a link to the javadoc files
         String str = readFile( new File( xrefDir, "nojavadocdir/test/AppSample.html" ) );
-        assertTrue( str.toLowerCase().indexOf( "/apidocs/nojavadocdir/test/AppSample.html".toLowerCase() ) != -1 );
+        assertTrue( str.toLowerCase( Locale.US ).indexOf( "/apidocs/nojavadocdir/test/appsample.html") != -1 );
 
         str = readFile( new File( xrefDir, "nojavadocdir/test/App.html" ) );
-        assertTrue( str.toLowerCase().indexOf( "/apidocs/nojavadocdir/test/app.html".toLowerCase() ) != -1 );
+        assertTrue( str.toLowerCase( Locale.US ).indexOf( "/apidocs/nojavadocdir/test/app.html" ) != -1 );
 
     }