]> source.dussan.org Git - archiva.git/commitdiff
Remove Sonar Dead Store Issues. 18/head
authorBernd Eckenfels <bernd@eckenfels.net>
Mon, 12 Oct 2015 22:54:04 +0000 (00:54 +0200)
committerBernd Eckenfels <bernd@eckenfels.net>
Mon, 12 Oct 2015 22:54:04 +0000 (00:54 +0200)
archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryScanStatistics.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/Maven3DependencyTreeBuilder.java
archiva-modules/plugins/stage-repository-merge/src/main/java/org/apache/archiva/stagerepository/merge/Maven2RepositoryMerger.java

index d5b862b825ceb71dd5e77fb4e4ea1288e321589f..8e2dd8341d36549f11b2ebe63589c751af955163 100644 (file)
@@ -97,14 +97,12 @@ public class RepositoryScanStatistics
 
     public void increaseFileCount()
     {
-        long count = getTotalFileCount();
-        this.totalFileCount = ++count;
+        this.totalFileCount += 1;
     }
 
     public void increaseNewFileCount()
     {
-        long count = getNewFileCount();
-        this.newFileCount = ++count;
+        this.newFileCount += 1;
     }
 
     public void setKnownConsumers( List<String> consumers )
index 348f5d0655e832d6b22b59bb79f48b8b188cc325..e0660c269fa1c15e02cae00d2b7aea5a21d670fb 100644 (file)
@@ -423,7 +423,7 @@ public class DefaultRepositoriesService
             String timestamp = null;
 
             File versionMetadataFile = new File( targetPath, MetadataTools.MAVEN_METADATA );
-            ArchivaRepositoryMetadata versionMetadata = getMetadata( versionMetadataFile );
+            /* unused */ getMetadata( versionMetadataFile );
 
             if ( !targetPath.exists() )
             {
@@ -482,6 +482,7 @@ public class DefaultRepositoriesService
                 "Artifact \'" + artifactTransferRequest.getGroupId() + ":" + artifactTransferRequest.getArtifactId()
                     + ":" + artifactTransferRequest.getVersion() + "\' was successfully deployed to repository \'"
                     + artifactTransferRequest.getTargetRepositoryId() + "\'";
+            log.debug("copyArtifact {}", msg);
 
         }
         catch ( RepositoryException e )
index 6e6c9056538440aef73dbfffdf38db0e107f23eb..e4d6676d62db363183fdcc572e81cce89462fa27 100644 (file)
@@ -189,7 +189,7 @@ public class DefaultFileUploadService
         // try with full name as ui only know the file name
         if ( !removed )
         {
-            removed = getSessionFileMetadatas().remove( new FileMetadata( file.getPath() ) );
+            /* unused */ getSessionFileMetadatas().remove( new FileMetadata( file.getPath() ) );
         }
         if ( file.exists() )
         {
index 6acf622e1f741942e388d6c3c17753fea7e560b1..adb1a875e4ffd42c73c75a0c93ee2896bdbfaf76 100644 (file)
@@ -280,12 +280,8 @@ public class Maven3DependencyTreeBuilder
         DependencySelector depFilter = new AndDependencySelector( new ExclusionDependencySelector() );
         session.setDependencySelector( depFilter );
 
-        LocalRepository localRepo = new LocalRepository( localRepoDir );
         session.setLocalRepositoryManager(
-            new SimpleLocalRepositoryManager( localRepoDir ) );// system.newLocalRepositoryManager( localRepo ) );
-
-        //session.setTransferListener(  );
-        //session.setRepositoryListener( n );
+            new SimpleLocalRepositoryManager( localRepoDir ) );
 
         return session;
     }
index 892a461ba4ff22abad0421468508c1c192b3ec0c..7a974db3ce6e9e9c397636836e1ac61fad6f9285 100644 (file)
@@ -193,9 +193,6 @@ public class Maven2RepositoryMerger
         // artifact copying
         copyFile( sourceArtifactFile, targetArtifactFile );
 
-        // pom file copying
-        String fileName = artifactMetadata.getProject() + "-" + artifactMetadata.getVersion() + ".pom";
-
         // pom file copying
         // TODO need to use path translator to get the pom file path
 //        String fileName = artifactMetadata.getProject() + "-" + artifactMetadata.getVersion() + ".pom";