maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From go...@apache.org
Subject svn commit: r1134851 - in /maven/scm/trunk/maven-scm-providers: maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/diff/ maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/repository/ maven-sc...
Date Sun, 12 Jun 2011 01:24:06 GMT
Author: godin
Date: Sun Jun 12 01:24:05 2011
New Revision: 1134851

URL: http://svn.apache.org/viewvc?rev=1134851&view=rev
Log:
Improve quality according to Sonar report

Use String.indexOf(char) when checking for the index of a single character - it executes faster.


Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/diff/BazaarDiffConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/repository/BazaarScmProviderRepository.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepository.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/PerforceScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/StarteamScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/ChangedFileConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/FileListConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssChangeLogConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/blame/CvsBlameConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepository.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/repository/GitScmProviderRepository.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/update/GitUpdateCommandConsumer.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtils.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepository.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtils.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/diff/BazaarDiffConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/diff/BazaarDiffConsumer.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/diff/BazaarDiffConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/command/diff/BazaarDiffConsumer.java
Sun Jun 12 01:24:05 2011
@@ -135,7 +135,7 @@ public class BazaarDiffConsumer
 
         if ( !ok )
         {
-            int index = tmpLine.indexOf( "/" );
+            int index = tmpLine.indexOf( '/' );
             if ( index > -1 )
             {
                 tmpLine = tmpLine.substring( index + 1 );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/repository/BazaarScmProviderRepository.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/repository/BazaarScmProviderRepository.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/repository/BazaarScmProviderRepository.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-bazaar/src/main/java/org/apache/maven/scm/provider/bazaar/repository/BazaarScmProviderRepository.java
Sun Jun 12 01:24:05 2011
@@ -186,7 +186,7 @@ public class BazaarScmProviderRepository
     {
         if ( !FILE.equals( protocol ) )
         {
-            int indexSlash = url.indexOf( "/" );
+            int indexSlash = url.indexOf( '/' );
 
             String hostPort = url;
             if ( indexSlash > 0 )
@@ -194,7 +194,7 @@ public class BazaarScmProviderRepository
                 hostPort = url.substring( 0, indexSlash );
             }
 
-            int indexColon = hostPort.indexOf( ":" );
+            int indexColon = hostPort.indexOf( ':' );
             if ( indexColon > 0 )
             {
                 setHost( hostPort.substring( 0, indexColon ) );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepository.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepository.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepository.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-hg/src/main/java/org/apache/maven/scm/provider/hg/repository/HgScmProviderRepository.java
Sun Jun 12 01:24:05 2011
@@ -143,7 +143,7 @@ public class HgScmProviderRepository
     {
         if ( protocol != FILE )
         {
-            int indexSlash = url.indexOf( "/" );
+            int indexSlash = url.indexOf( '/' );
 
             String hostPort = url;
             if ( indexSlash > 0 )
@@ -151,7 +151,7 @@ public class HgScmProviderRepository
                 hostPort = url.substring( 0, indexSlash );
             }
 
-            int indexColon = hostPort.indexOf( ":" );
+            int indexColon = hostPort.indexOf( ':' );
             if ( indexColon > 0 )
             {
                 setHost( hostPort.substring( 0, indexColon ) );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/PerforceScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/PerforceScmProvider.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/PerforceScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-perforce/src/main/java/org/apache/maven/scm/provider/perforce/PerforceScmProvider.java
Sun Jun 12 01:24:05 2011
@@ -121,13 +121,13 @@ public class PerforceScmProvider
 
         String user = null;
         String password = null;
-        if ( host != null && host.indexOf( "@" ) > 1 )
+        if ( host != null && host.indexOf( '@' ) > 1 )
         {
-            user = host.substring( 0, host.indexOf( "@" ) );
-            host = host.substring( host.indexOf( "@" ) + 1 );
+            user = host.substring( 0, host.indexOf( '@' ) );
+            host = host.substring( host.indexOf( '@' ) + 1 );
         }
 
-        if ( path.indexOf( "@" ) > 1 )
+        if ( path.indexOf( '@' ) > 1 )
         {
             if ( host != null )
             {
@@ -139,8 +139,8 @@ public class PerforceScmProvider
                 }
             }
 
-            user = path.substring( 0, path.indexOf( "@" ) );
-            path = path.substring( path.indexOf( "@" ) + 1 );
+            user = path.substring( 0, path.indexOf( '@' ) );
+            path = path.substring( path.indexOf( '@' ) + 1 );
         }
 
         return new PerforceScmProviderRepository( host, port, path, user, password );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/StarteamScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/StarteamScmProvider.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/StarteamScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/StarteamScmProvider.java
Sun Jun 12 01:24:05 2011
@@ -88,7 +88,7 @@ public class StarteamScmProvider
 
             rest = scmSpecificUrl.substring( index + 1 );
 
-            index = userAndPassword.indexOf( ":" );
+            index = userAndPassword.indexOf( ':' );
 
             if ( index != -1 )
             {

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java
Sun Jun 12 01:24:05 2011
@@ -196,14 +196,14 @@ public class StarteamCommandLineUtils
 
         retStr = fullStr.substring( 0, usernamePos );
 
-        int passwordStartPos = fullStr.indexOf( ":" );
+        int passwordStartPos = fullStr.indexOf( ':' );
 
         if ( passwordStartPos == -1 )
         {
             throw new ScmException( "Invalid command line" );
         }
 
-        int passwordEndPos = fullStr.indexOf( "@" );
+        int passwordEndPos = fullStr.indexOf( '@' );
 
         if ( passwordEndPos == -1 )
         {

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-synergy/src/test/java/org/apache/maven/scm/provider/synergy/util/SynergyCCMTest.java
Sun Jun 12 01:24:05 2011
@@ -74,7 +74,7 @@ public class SynergyCCMTest
         list.add( f );
         Commandline cl = SynergyCCM.create( list, "test creation", "CCM_ADDR" );
         assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(),
"CCM_ADDR=CCM_ADDR" ) );
-        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        if ( f.getCanonicalPath().indexOf( ' ' ) > -1 )
         {
             assertCommandLine( "ccm create -c \"test creation\" \"" + f.getCanonicalPath()
+ "\"", null, cl );
         }
@@ -86,9 +86,9 @@ public class SynergyCCMTest
         f2.deleteOnExit();
         list.add( f2 );
         cl = SynergyCCM.create( list, "test creation", "CCM_ADDR" );
-        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        if ( f.getCanonicalPath().indexOf( ' ' ) > -1 )
         {
-            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            if ( f2.getCanonicalPath().indexOf( ' ' ) > -1 )
             {
                 assertCommandLine( "ccm create -c \"test creation\" \"" + f.getCanonicalPath()
+ "\" \"" +
                     f2.getCanonicalPath() + "\"", null, cl );
@@ -102,7 +102,7 @@ public class SynergyCCMTest
         }
         else
         {
-            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            if ( f2.getCanonicalPath().indexOf( ' ' ) > -1 )
             {
                 assertCommandLine(
                     "ccm create -c \"test creation\" " + f.getCanonicalPath() + " \"" + f2.getCanonicalPath()
+ "\"",
@@ -155,7 +155,7 @@ public class SynergyCCMTest
         list.add( f );
         Commandline cl = SynergyCCM.delete( list, "CCM_ADDR", true );
         assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(),
"CCM_ADDR=CCM_ADDR" ) );
-        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        if ( f.getCanonicalPath().indexOf( ' ' ) > -1 )
         {
             assertCommandLine( "ccm delete -replace \"" + f.getCanonicalPath() + "\"", null,
cl );
         }
@@ -167,9 +167,9 @@ public class SynergyCCMTest
         f2.deleteOnExit();
         list.add( f2 );
         cl = SynergyCCM.delete( list, "CCM_ADDR", false );
-        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        if ( f.getCanonicalPath().indexOf( ' ' ) > -1 )
         {
-            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            if ( f2.getCanonicalPath().indexOf( ' ' ) > -1 )
             {
                 assertCommandLine( "ccm delete \"" + f.getCanonicalPath() + "\" \"" + f2.getCanonicalPath()
+ "\"",
                                    null, cl );
@@ -182,7 +182,7 @@ public class SynergyCCMTest
         }
         else
         {
-            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            if ( f2.getCanonicalPath().indexOf( ' ' ) > -1 )
             {
                 assertCommandLine( "ccm delete " + f.getCanonicalPath() + " \"" + f2.getCanonicalPath()
+ "\"", null,
                                    cl );
@@ -250,7 +250,7 @@ public class SynergyCCMTest
         list.add( f );
         Commandline cl = SynergyCCM.checkoutFiles( list, "CCM_ADDR" );
         assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(),
"CCM_ADDR=CCM_ADDR" ) );
-        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        if ( f.getCanonicalPath().indexOf( ' ' ) > -1 )
         {
             assertCommandLine( "ccm co \"" + f.getCanonicalPath() + "\"", null, cl );
         }
@@ -262,9 +262,9 @@ public class SynergyCCMTest
         f2.deleteOnExit();
         list.add( f2 );
         cl = SynergyCCM.checkoutFiles( list, "CCM_ADDR" );
-        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        if ( f.getCanonicalPath().indexOf( ' ' ) > -1 )
         {
-            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            if ( f2.getCanonicalPath().indexOf( ' ' ) > -1 )
             {
                 assertCommandLine( "ccm co \"" + f.getCanonicalPath() + "\" \"" + f2.getCanonicalPath()
+ "\"", null,
                                    cl );
@@ -276,7 +276,7 @@ public class SynergyCCMTest
         }
         else
         {
-            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            if ( f2.getCanonicalPath().indexOf( ' ' ) > -1 )
             {
                 assertCommandLine( "ccm co " + f.getCanonicalPath() + " \"" + f2.getCanonicalPath()
+ "\"", null, cl );
             }
@@ -299,7 +299,7 @@ public class SynergyCCMTest
         f.deleteOnExit();
         cl = SynergyCCM.checkoutProject( f.getParentFile(), "MyProject", new ScmTag( "MyVersion"
), "MyPurpose",
                                          "MyRelease", "CCM_ADDR" );
-        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        if ( f.getCanonicalPath().indexOf( ' ' ) > -1 )
         {
             assertCommandLine( "ccm co -subprojects -rel -t MyVersion -purpose MyPurpose
-release MyRelease -path \"" +
                 f.getParentFile().getCanonicalPath() + "\" -p MyProject", null, cl );
@@ -328,7 +328,7 @@ public class SynergyCCMTest
         list.add( f );
         Commandline cl = SynergyCCM.checkinFiles( list, "a comment", "CCM_ADDR" );
         assertTrue( "CCM_ADDR is not set.", assertContains( cl.getEnvironmentVariables(),
"CCM_ADDR=CCM_ADDR" ) );
-        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        if ( f.getCanonicalPath().indexOf( ' ' ) > -1 )
         {
             assertCommandLine( "ccm ci -c \"a comment\" \"" + f.getCanonicalPath() + "\"",
null, cl );
         }
@@ -340,9 +340,9 @@ public class SynergyCCMTest
         f2.deleteOnExit();
         list.add( f2 );
         cl = SynergyCCM.checkinFiles( list, "a comment", "CCM_ADDR" );
-        if ( f.getCanonicalPath().indexOf( " " ) > -1 )
+        if ( f.getCanonicalPath().indexOf( ' ' ) > -1 )
         {
-            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            if ( f2.getCanonicalPath().indexOf( ' ' ) > -1 )
             {
                 assertCommandLine(
                     "ccm ci -c \"a comment\" \"" + f.getCanonicalPath() + "\" \"" + f2.getCanonicalPath()
+ "\"", null,
@@ -357,7 +357,7 @@ public class SynergyCCMTest
         }
         else
         {
-            if ( f2.getCanonicalPath().indexOf( " " ) > -1 )
+            if ( f2.getCanonicalPath().indexOf( ' ' ) > -1 )
             {
                 assertCommandLine(
                     "ccm ci -c \"a comment\" " + f.getCanonicalPath() + " \"" + f2.getCanonicalPath()
+ "\"", null,

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/ChangedFileConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/ChangedFileConsumer.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/ChangedFileConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/ChangedFileConsumer.java
Sun Jun 12 01:24:05 2011
@@ -54,7 +54,7 @@ public class ChangedFileConsumer
 
     public void consumeLine( String line )
     {
-        if ( line.indexOf( ":" ) >= 0 )
+        if ( line.indexOf( ':' ) >= 0 )
         {
             String[] s = line.split( ":", 2 );
             if ( s.length > 1 )

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/FileListConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/FileListConsumer.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/FileListConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-tfs/src/main/java/org/apache/maven/scm/provider/tfs/command/consumer/FileListConsumer.java
Sun Jun 12 01:24:05 2011
@@ -53,7 +53,7 @@ public class FileListConsumer
         {
             currentDir = "";
         }
-        else if ( !currentDir.equals( "" ) && line.indexOf( " " ) >= 0 )
+        else if ( !currentDir.equals( "" ) && line.indexOf( ' ' ) >= 0 )
         {
             String filename = line.split( " " )[1];
             files.add( getScmFile( filename ) );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssChangeLogConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssChangeLogConsumer.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssChangeLogConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-vss/src/main/java/org/apache/maven/scm/provider/vss/commands/changelog/VssChangeLogConsumer.java
Sun Jun 12 01:24:05 2011
@@ -224,7 +224,7 @@ public class VssChangeLogConsumer
         {
             String fileName = currentFile.getName();
 
-            String path = line.substring( line.indexOf( "$" ), line.length() );
+            String path = line.substring( line.indexOf( '$' ), line.length() );
             String longPath = path.substring( repo.getProject()
                 .length() + 1, path.length() ) + "/" + fileName;
             currentFile.setName( longPath );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java
Sun Jun 12 01:24:05 2011
@@ -491,7 +491,7 @@ public abstract class AbstractCvsScmProv
                 //pserver:[username@]host:path:module
                 String userhost = tokens[1];
 
-                int index = userhost.indexOf( "@" );
+                int index = userhost.indexOf( '@' );
 
                 if ( index == -1 )
                 {
@@ -515,7 +515,7 @@ public abstract class AbstractCvsScmProv
 
                 String passhost = tokens[2];
 
-                int index = passhost.indexOf( "@" );
+                int index = passhost.indexOf( '@' );
 
                 if ( index == -1 )
                 {
@@ -538,12 +538,12 @@ public abstract class AbstractCvsScmProv
             else
             {
                 //tokens.length == 5
-                if ( tokens[1].indexOf( "@" ) > 0 )
+                if ( tokens[1].indexOf( '@' ) > 0 )
                 {
                     //pserver:username@host:port:path:module
                     String userhost = tokens[1];
 
-                    int index = userhost.indexOf( "@" );
+                    int index = userhost.indexOf( '@' );
 
                     user = userhost.substring( 0, index );
 
@@ -551,7 +551,7 @@ public abstract class AbstractCvsScmProv
 
                     port = new Integer( tokens[2] ).intValue();
                 }
-                else if ( tokens[2].indexOf( "@" ) >= 0 )
+                else if ( tokens[2].indexOf( '@' ) >= 0 )
                 {
                     //pserver:username:password@host:path:module
                     //<username>:<password>@<hostname>
@@ -559,7 +559,7 @@ public abstract class AbstractCvsScmProv
 
                     String passhost = tokens[2];
 
-                    int index = passhost.indexOf( "@" );
+                    int index = passhost.indexOf( '@' );
 
                     password = passhost.substring( 0, index );
 
@@ -610,7 +610,7 @@ public abstract class AbstractCvsScmProv
             //sspi:[username@]host:[port]path:module
             String userhost = tokens[1];
 
-            int index = userhost.indexOf( "@" );
+            int index = userhost.indexOf( '@' );
 
             if ( index == -1 )
             {
@@ -665,7 +665,7 @@ public abstract class AbstractCvsScmProv
             {
                 String userhost = tokens[1];
 
-                int index = userhost.indexOf( "@" );
+                int index = userhost.indexOf( '@' );
 
                 if ( index == -1 )
                 {

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/blame/CvsBlameConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/blame/CvsBlameConsumer.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/blame/CvsBlameConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/blame/CvsBlameConsumer.java
Sun Jun 12 01:24:05 2011
@@ -59,7 +59,7 @@ public class CvsBlameConsumer
 
     public void consumeLine( String line )
     {
-        if (line != null && line.indexOf( ":" ) > 0 )
+        if (line != null && line.indexOf( ':' ) > 0 )
         {
             String annotation = line.substring( 0, line.indexOf( ':' ) );
             if ( lineRegexp.match( annotation ) )

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepository.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepository.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepository.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/repository/CvsScmProviderRepository.java
Sun Jun 12 01:24:05 2011
@@ -153,7 +153,7 @@ public class CvsScmProviderRepository
         //:transport:rest_of_cvsroot
         int indexOfUsername = getTransport().length() + 2;
 
-        int indexOfAt = cvsroot.indexOf( "@" );
+        int indexOfAt = cvsroot.indexOf( '@' );
 
         String userString = user == null ? "" : ":" + user;
 

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProvider.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProvider.java
Sun Jun 12 01:24:05 2011
@@ -201,7 +201,7 @@ public class CvsExeScmProvider
             //sspi:[username@]host:[port]path:module
             String userhost = tokens[1];
 
-            int index = userhost.indexOf( "@" );
+            int index = userhost.indexOf( '@' );
 
             if ( index == -1 )
             {

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/repository/GitScmProviderRepository.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/repository/GitScmProviderRepository.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/repository/GitScmProviderRepository.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/repository/GitScmProviderRepository.java
Sun Jun 12 01:24:05 2011
@@ -333,11 +333,11 @@ public class GitScmProviderRepository
         throws ScmException
     {
         // extract user information
-        int indexAt = url.indexOf( "@" );
+        int indexAt = url.indexOf( '@' );
         if ( indexAt >= 0 )
         {
             String userInfo = url.substring( 0, indexAt );
-            int indexPwdSep = userInfo.indexOf( ":" ); 
+            int indexPwdSep = userInfo.indexOf( ':' );
             if ( indexPwdSep < 0 )
             {
                 repoUrl.setUserName( userInfo );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/update/GitUpdateCommandConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/update/GitUpdateCommandConsumer.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/update/GitUpdateCommandConsumer.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/update/GitUpdateCommandConsumer.java
Sun Jun 12 01:24:05 2011
@@ -88,7 +88,7 @@ public class GitUpdateCommandConsumer
             else
             {
                 // test other format : pom.xml |    3 +--
-                index = line.indexOf( "|" );
+                index = line.indexOf( '|' );
                 if ( index >= 0 )
                 {
                     String fileName = StringUtils.trim( line.substring( 0, index ) );

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtils.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtils.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtils.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/SvnTagBranchUtils.java
Sun Jun 12 01:24:05 2011
@@ -207,9 +207,9 @@ public class SvnTagBranchUtils
 
         // Look for a query string as in ViewCVS urls
         String queryString = null;
-        if ( repositoryUrl.indexOf( "?" ) >= 0 )
+        if ( repositoryUrl.indexOf( '?' ) >= 0 )
         {
-            queryString = repositoryUrl.substring( repositoryUrl.indexOf( "?" ) );
+            queryString = repositoryUrl.substring( repositoryUrl.indexOf( '?' ) );
             // if repositoryUrl contains a query string, remove it from repositoryUrlRoot;
will be re-appended later
             projectRoot = StringUtils.replace( projectRoot, queryString, "" );
         }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepository.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepository.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepository.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svn-commons/src/main/java/org/apache/maven/scm/provider/svn/repository/SvnScmProviderRepository.java
Sun Jun 12 01:24:05 2011
@@ -159,19 +159,19 @@ public class SvnScmProviderRepository
 
         String urlPath = url.substring( getProtocol().length() );
 
-        int indexAt = urlPath.indexOf( "@" );
+        int indexAt = urlPath.indexOf( '@' );
 
         if ( indexAt > 0 && !getProtocol().startsWith( "svn+" ) )
         {
             String userPassword = urlPath.substring( 0, indexAt );
-            if ( userPassword.indexOf( ":" ) < 0 )
+            if ( userPassword.indexOf( ':' ) < 0 )
             {
                 setUser( userPassword );
             }
             else
             {
-                setUser( userPassword.substring( 0, userPassword.indexOf( ":" ) ) );
-                setPassword( userPassword.substring( userPassword.indexOf( ":" ) + 1 ) );
+                setUser( userPassword.substring( 0, userPassword.indexOf( ':' ) ) );
+                setPassword( userPassword.substring( userPassword.indexOf( ':' ) + 1 ) );
             }
 
             urlPath = urlPath.substring( indexAt + 1 );
@@ -185,7 +185,7 @@ public class SvnScmProviderRepository
 
         if ( !"file://".equals( getProtocol() ) )
         {
-            int indexSlash = urlPath.indexOf( "/" );
+            int indexSlash = urlPath.indexOf( '/' );
 
             String hostPort = urlPath;
 
@@ -194,7 +194,7 @@ public class SvnScmProviderRepository
                 hostPort = urlPath.substring( 0, indexSlash );
             }
 
-            int indexColon = hostPort.indexOf( ":" );
+            int indexColon = hostPort.indexOf( ':' );
 
             if ( indexColon > 0 )
             {
@@ -223,7 +223,7 @@ public class SvnScmProviderRepository
             newUrl = newUrl.substring( 0, newUrl.length() );
         }
 
-        int i = newUrl.lastIndexOf( "/" );
+        int i = newUrl.lastIndexOf( '/' );
 
         if ( i < 0 )
         {

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtils.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtils.java?rev=1134851&r1=1134850&r2=1134851&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtils.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/main/java/org/apache/maven/scm/provider/svn/svnexe/command/SvnCommandLineUtils.java
Sun Jun 12 01:24:05 2011
@@ -215,7 +215,7 @@ public class SvnCommandLineUtils
         {
             String beforePassword = clString.substring( 0, pos + "--password ".length() );
             String afterPassword = clString.substring( pos + "--password ".length() );
-            afterPassword = afterPassword.substring( afterPassword.indexOf( " " ) );
+            afterPassword = afterPassword.substring( afterPassword.indexOf( ' ' ) );
             if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
             {
                 clString = beforePassword + "*****" + afterPassword;



Mime
View raw message