maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1072529 - /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
Date Sun, 20 Feb 2011 08:37:56 GMT
Author: struberg
Date: Sun Feb 20 08:37:56 2011
New Revision: 1072529

URL: http://svn.apache.org/viewvc?rev=1072529&view=rev
Log:
fix PMD warnings

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

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=1072529&r1=1072528&r2=1072529&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 Feb 20 08:37:56 2011
@@ -61,14 +61,12 @@ public class GitUpdateCommandConsumer
         {
             return;
         }
-        if ( !updatingFound )
+        if ( !updatingFound && line.startsWith( "Updating" ) )
         {
-            if ( line.startsWith( "Updating" ) )
-            {
-                updatingFound = true;
-                return;
-            }
+            updatingFound = true;
+            return;
         }
+
         // skip summary line
         //1 files changed, 1 insertions(+), 1 deletions(-)←[m
         if ( line.indexOf( "files changed" ) >= 0 )
@@ -107,23 +105,20 @@ public class GitUpdateCommandConsumer
             // delete mode 100644 README
             // create mode 100644 test.txt
             String[] changedFileLine = StringUtils.split( line, " " );
-            if ( changedFileLine != null )
+            if ( changedFileLine != null && changedFileLine.length >= 4 )
             {
-                if ( changedFileLine.length >= 4 )
+                String status = changedFileLine[0];
+                String fileName = changedFileLine[3];
+                ScmFile scmFile = (ScmFile) scmFiles.get( fileName );
+                if ( scmFile != null )
                 {
-                    String status = changedFileLine[0];
-                    String fileName = changedFileLine[3];
-                    ScmFile scmFile = (ScmFile) scmFiles.get( fileName );
-                    if ( scmFile != null )
+                    if ( StringUtils.equalsIgnoreCase( "delete", status ) )
+                    {
+                        scmFiles.put( fileName, new ScmFile( fileName, ScmFileStatus.DELETED
) );
+                    }
+                    if ( StringUtils.equalsIgnoreCase( "create", status ) )
                     {
-                        if ( StringUtils.equalsIgnoreCase( "delete", status ) )
-                        {
-                            scmFiles.put( fileName, new ScmFile( fileName, ScmFileStatus.DELETED
) );
-                        }
-                        if ( StringUtils.equalsIgnoreCase( "create", status ) )
-                        {
-                            scmFiles.put( fileName, new ScmFile( fileName, ScmFileStatus.ADDED
) );
-                        }
+                        scmFiles.put( fileName, new ScmFile( fileName, ScmFileStatus.ADDED
) );
                     }
                 }
             }



Mime
View raw message