cstamas commented on a change in pull request #139:
URL: https://github.com/apache/maven-resolver/pull/139#discussion_r787548146



##########
File path: 
maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayout.java
##########
@@ -83,39 +84,34 @@ public static Checksum forLocation( URI location, String 
algorithm )
             {
                 throw new IllegalArgumentException( "resource location must 
not have a fragment: " + location );
             }
-            String extension = '.' + algorithm.replace( "-", "" ).toLowerCase( 
Locale.ENGLISH );
-            return new Checksum( algorithm, URI.create( location.toString() + 
extension ) );
+            return new ChecksumLocation( URI.create( location + "." + 
checksumAlgorithmFactory.getExtension() ),
+                    checksumAlgorithmFactory );
         }
 
-        private static void verify( String algorithm, URI location )
+        private static void verify( URI location, ChecksumAlgorithmFactory 
checksumAlgorithmFactory )
         {
-            requireNonNull( algorithm, "checksum algorithm cannot be null" );
-            if ( algorithm.length() == 0 )
-            {
-                throw new IllegalArgumentException( "checksum algorithm cannot 
be empty" );
-            }
             requireNonNull( location, "checksum location cannot be null" );
             if ( location.isAbsolute() )
             {
                 throw new IllegalArgumentException( "checksum location must be 
relative" );
             }
+            requireNonNull( checksumAlgorithmFactory, "checksum algorithm 
cannot be null" );

Review comment:
       fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to