[maven-artifact-transfer] branch MSHARED-802 created (now 65c572d)

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

[maven-artifact-transfer] branch MSHARED-802 created (now 65c572d)

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

khmarbaise pushed a change to branch MSHARED-802
in repository https://gitbox.apache.org/repos/asf/maven-artifact-transfer.git.


      at 65c572d  [MSHARED-802] - Wrongly check filter parameter which is allowed to be null.

This branch includes the following new commits:

     new 65c572d  [MSHARED-802] - Wrongly check filter parameter which is allowed to be null.

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-artifact-transfer] 01/01: [MSHARED-802] - Wrongly check filter parameter which is allowed to be null.

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

khmarbaise pushed a commit to branch MSHARED-802
in repository https://gitbox.apache.org/repos/asf/maven-artifact-transfer.git

commit 65c572d278a4b0b15f53b3f7dd87a60130c320c1
Author: Karl Heinz Marbaise <[hidden email]>
AuthorDate: Sun Feb 10 22:02:36 2019 +0100

    [MSHARED-802] - Wrongly check filter parameter which is allowed to be null.
---
 .../dependencies/resolve/DependencyResolver.java   |  4 ++--
 .../internal/DefaultDependencyResolver.java        |  9 --------
 .../internal/DefaultDependencyResolverTest.java    | 24 ----------------------
 3 files changed, 2 insertions(+), 35 deletions(-)

diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolver.java b/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolver.java
index 7a066a6..23baf51 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolver.java
+++ b/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/DependencyResolver.java
@@ -41,7 +41,7 @@ public interface DependencyResolver
      *
      * @param buildingRequest {@link ProjectBuildingRequest}
      * @param coordinate {@link DependableCoordinate}
-     * @param filter {@link TransformableFilter}
+     * @param filter {@link TransformableFilter} (can be {@code null}).
      * @return the resolved dependencies.
      * @throws DependencyResolverException in case of an error.
      */
@@ -57,7 +57,7 @@ public interface DependencyResolver
      *
      * @param buildingRequest {@link ProjectBuildingRequest}
      * @param model {@link Model}
-     * @param filter {@link TransformableFilter}
+     * @param filter {@link TransformableFilter} (can be {@code null}).
      * @return the resolved dependencies.
      * @throws DependencyResolverException in case of an error.
      */
diff --git a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java b/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java
index 291f95d..9170bc1 100644
--- a/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java
+++ b/src/main/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolver.java
@@ -152,11 +152,6 @@ class DefaultDependencyResolver
         {
             throw new IllegalArgumentException( "The parameter coordinate is not allowed to be null." );
         }
-        if ( filter == null )
-        {
-            throw new IllegalArgumentException( "The parameter filter is not allowed to be null." );
-        }
-
     }
 
     private void validateParameters( ProjectBuildingRequest buildingRequest, Model model,
@@ -167,10 +162,6 @@ class DefaultDependencyResolver
         {
             throw new IllegalArgumentException( "The parameter model is not allowed to be null." );
         }
-        if ( filter == null )
-        {
-            throw new IllegalArgumentException( "The parameter filter is not allowed to be null." );
-        }
 
     }
 
diff --git a/src/test/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolverTest.java b/src/test/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolverTest.java
index 7f042f0..db8314c 100644
--- a/src/test/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolverTest.java
+++ b/src/test/java/org/apache/maven/shared/transfer/dependencies/resolve/internal/DefaultDependencyResolverTest.java
@@ -72,18 +72,6 @@ public class DefaultDependencyResolverTest
     }
 
     @Test
-    public void resolveDependenciesWithDependableCoordinatShouldFailWithIAEWhenParameterFilterIsNull()
-        throws DependencyResolverException
-    {
-        thrown.expect( IllegalArgumentException.class );
-        thrown.expectMessage( "The parameter filter is not allowed to be null." );
-
-        ProjectBuildingRequest request = mock( ProjectBuildingRequest.class );
-        DependableCoordinate dc = mock( DependableCoordinate.class );
-        dr.resolveDependencies( request, dc, null );
-    }
-
-    @Test
     public void resolveDependenciesWithModelShouldFailWithIAEWhenParameterBuildingRequestIsNull()
         throws DependencyResolverException
     {
@@ -104,16 +92,4 @@ public class DefaultDependencyResolverTest
         dr.resolveDependencies( request, (Model) null, null );
     }
 
-    @Test
-    public void resolveDependenciesWithModelShouldFailWithIAEWhenParameterFilterIsNull()
-        throws DependencyResolverException
-    {
-        thrown.expect( IllegalArgumentException.class );
-        thrown.expectMessage( "The parameter filter is not allowed to be null." );
-
-        ProjectBuildingRequest request = mock( ProjectBuildingRequest.class );
-        Model model = mock( Model.class );
-        dr.resolveDependencies( request, model, null );
-    }
-
 }