[maven-resolver] branch remove-unused created (now f8f0ef5)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[maven-resolver] branch remove-unused created (now f8f0ef5)

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

michaelo pushed a change to branch remove-unused
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git.


      at f8f0ef5  Remove unused parameters and local variables

This branch includes the following new commits:

     new f8f0ef5  Remove unused parameters and local variables

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.


Reply | Threaded
Open this post in threaded view
|

[maven-resolver] 01/01: Remove unused parameters and local variables

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

michaelo pushed a commit to branch remove-unused
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git

commit f8f0ef5771dd6ed0a6bb9a79586b3fe4e2c4b9a5
Author: Piotrek Żygieło <[hidden email]>
AuthorDate: Fri Oct 9 21:19:17 2020 +0200

    Remove unused parameters and local variables
   
    This closes #75
---
 .../connector/basic/BasicRepositoryConnector.java  |  7 ++--
 .../internal/impl/DefaultUpdateCheckManager.java   | 41 ++++++++++------------
 .../aether/transport/wagon/WagonTransporter.java   |  5 ++-
 3 files changed, 24 insertions(+), 29 deletions(-)

diff --git a/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnector.java b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnector.java
index 66605ee..3fed9a1 100644
--- a/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnector.java
+++ b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnector.java
@@ -549,12 +549,12 @@ final class BasicRepositoryConnector
 
                 byte[] bytes = baos.toByteArray();
                 transporter.put( new PutTask( path ).setDataBytes( bytes ).setListener( listener ) );
-                uploadChecksums( file, bytes, path );
+                uploadChecksums( file, bytes );
             }
             else
             {
                 transporter.put( new PutTask( path ).setDataFile( file ).setListener( listener ) );
-                uploadChecksums( file, null , path );
+                uploadChecksums( file, null );
             }
         }
 
@@ -562,9 +562,8 @@ final class BasicRepositoryConnector
          *
          * @param file source
          * @param bytes transformed data from file or {@code null}
-         * @param location target
          */
-        private void uploadChecksums( File file, byte[] bytes, URI location )
+        private void uploadChecksums( File file, byte[] bytes )
         {
             if ( checksums.isEmpty() )
             {
diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java
index f1892c5..d8dab4b 100644
--- a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java
+++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java
@@ -121,11 +121,11 @@ public class DefaultUpdateCheckManager
 
         boolean fileExists = check.isFileValid() && artifactFile.exists();
 
-        File touchFile = getTouchFile( artifact, artifactFile );
+        File touchFile = getArtifactTouchFile( artifactFile );
         Properties props = read( touchFile );
 
         String updateKey = getUpdateKey( session, artifactFile, repository );
-        String dataKey = getDataKey( artifact, artifactFile, repository );
+        String dataKey = getDataKey( repository );
 
         String error = getError( props, dataKey );
 
@@ -151,7 +151,7 @@ public class DefaultUpdateCheckManager
         else
         {
             // artifact could not be transferred
-            String transferKey = getTransferKey( session, artifact, artifactFile, repository );
+            String transferKey = getTransferKey( session, repository );
             lastUpdated = getLastUpdated( props, transferKey );
         }
 
@@ -246,11 +246,11 @@ public class DefaultUpdateCheckManager
 
         boolean fileExists = check.isFileValid() && metadataFile.exists();
 
-        File touchFile = getTouchFile( metadata, metadataFile );
+        File touchFile = getMetadataTouchFile( metadataFile );
         Properties props = read( touchFile );
 
         String updateKey = getUpdateKey( session, metadataFile, repository );
-        String dataKey = getDataKey( metadata, metadataFile, check.getAuthoritativeRepository() );
+        String dataKey = getDataKey( metadataFile );
 
         String error = getError( props, dataKey );
 
@@ -276,7 +276,7 @@ public class DefaultUpdateCheckManager
         else
         {
             // metadata could not be transferred
-            String transferKey = getTransferKey( session, metadata, metadataFile, repository );
+            String transferKey = getTransferKey( session, metadataFile, repository );
             lastUpdated = getLastUpdated( props, transferKey );
         }
 
@@ -359,17 +359,17 @@ public class DefaultUpdateCheckManager
         return props.getProperty( key + ERROR_KEY_SUFFIX );
     }
 
-    private File getTouchFile( Artifact artifact, File artifactFile )
+    private File getArtifactTouchFile( File artifactFile )
     {
         return new File( artifactFile.getPath() + UPDATED_KEY_SUFFIX );
     }
 
-    private File getTouchFile( Metadata metadata, File metadataFile )
+    private File getMetadataTouchFile( File metadataFile )
     {
         return new File( metadataFile.getParent(), "resolver-status.properties" );
     }
 
-    private String getDataKey( Artifact artifact, File artifactFile, RemoteRepository repository )
+    private String getDataKey( RemoteRepository repository )
     {
         Set<String> mirroredUrls = Collections.emptySet();
         if ( repository.isRepositoryManager() )
@@ -392,19 +392,18 @@ public class DefaultUpdateCheckManager
         return buffer.toString();
     }
 
-    private String getTransferKey( RepositorySystemSession session, Artifact artifact, File artifactFile,
-                                   RemoteRepository repository )
+    private String getTransferKey( RepositorySystemSession session, RemoteRepository repository )
     {
         return getRepoKey( session, repository );
     }
 
-    private String getDataKey( Metadata metadata, File metadataFile, RemoteRepository repository )
+    private String getDataKey( File metadataFile )
     {
         return metadataFile.getName();
     }
 
-    private String getTransferKey( RepositorySystemSession session, Metadata metadata, File metadataFile,
-                                   RemoteRepository repository )
+    private String getTransferKey( RepositorySystemSession session, File metadataFile,
+                                  RemoteRepository repository )
     {
         return metadataFile.getName() + '/' + getRepoKey( session, repository );
     }
@@ -514,13 +513,12 @@ public class DefaultUpdateCheckManager
 
     public void touchArtifact( RepositorySystemSession session, UpdateCheck<Artifact, ArtifactTransferException> check )
     {
-        Artifact artifact = check.getItem();
         File artifactFile = check.getFile();
-        File touchFile = getTouchFile( artifact, artifactFile );
+        File touchFile = getArtifactTouchFile( artifactFile );
 
         String updateKey = getUpdateKey( session, artifactFile, check.getRepository() );
-        String dataKey = getDataKey( artifact, artifactFile, check.getAuthoritativeRepository() );
-        String transferKey = getTransferKey( session, artifact, artifactFile, check.getRepository() );
+        String dataKey = getDataKey( check.getAuthoritativeRepository() );
+        String transferKey = getTransferKey( session, check.getRepository() );
 
         setUpdated( session, updateKey );
         Properties props = write( touchFile, dataKey, transferKey, check.getException() );
@@ -545,13 +543,12 @@ public class DefaultUpdateCheckManager
 
     public void touchMetadata( RepositorySystemSession session, UpdateCheck<Metadata, MetadataTransferException> check )
     {
-        Metadata metadata = check.getItem();
         File metadataFile = check.getFile();
-        File touchFile = getTouchFile( metadata, metadataFile );
+        File touchFile = getMetadataTouchFile( metadataFile );
 
         String updateKey = getUpdateKey( session, metadataFile, check.getRepository() );
-        String dataKey = getDataKey( metadata, metadataFile, check.getAuthoritativeRepository() );
-        String transferKey = getTransferKey( session, metadata, metadataFile, check.getRepository() );
+        String dataKey = getDataKey( metadataFile );
+        String transferKey = getTransferKey( session, metadataFile, check.getRepository() );
 
         setUpdated( session, updateKey );
         write( touchFile, dataKey, transferKey, check.getException() );
diff --git a/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporter.java b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporter.java
index 6520d8f..c1eb637 100644
--- a/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporter.java
+++ b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporter.java
@@ -134,7 +134,7 @@ final class WagonTransporter
         repoAuthContext = AuthenticationContext.forRepository( session, repository );
         proxyAuthContext = AuthenticationContext.forProxy( session, repository );
 
-        wagonAuth = getAuthenticationInfo( repository, repoAuthContext );
+        wagonAuth = getAuthenticationInfo( repoAuthContext );
         wagonProxy = getProxy( repository, proxyAuthContext );
 
         headers = new Properties();
@@ -181,8 +181,7 @@ final class WagonTransporter
         return result;
     }
 
-    private AuthenticationInfo getAuthenticationInfo( RemoteRepository repository,
-                                                      final AuthenticationContext authContext )
+    private AuthenticationInfo getAuthenticationInfo( final AuthenticationContext authContext )
     {
         AuthenticationInfo auth = null;