You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/12/02 21:37:24 UTC

[GitHub] [maven] gnodet commented on a change in pull request #584: [MNG-6776] Inconsistent list of parameters for MojoDescriptor

gnodet commented on a change in pull request #584:
URL: https://github.com/apache/maven/pull/584#discussion_r761481644



##########
File path: maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java
##########
@@ -55,9 +56,7 @@
 
     private static final String DEFAULT_LANGUAGE = "java";
 
-    private List<Parameter> parameters;
-
-    private Map<String, Parameter> parameterMap;
+    private final ArrayList<Parameter> parameters;

Review comment:
       I tend to favour interfaces when possible:
   ```
   private final List<Parameter> parameters;
   ```

##########
File path: maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java
##########
@@ -539,53 +532,21 @@ public boolean equals( Object object )
         {
             MojoDescriptor other = (MojoDescriptor) object;
 
-            if ( !compareObjects( getPluginDescriptor(), other.getPluginDescriptor() ) )
+            if ( !Objects.equals( getPluginDescriptor(), other.getPluginDescriptor() ) )
             {
                 return false;
             }
 
-            return compareObjects( getGoal(), other.getGoal() );
-
+            return Objects.equals( getGoal(), other.getGoal() );

Review comment:
       What about a more usual:
   ```
               return Objects.equals( getPluginDescriptor(), other.getPluginDescriptor() )
                   && Objects.equals( getGoal(), other.getGoal() );
   ```




-- 
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-unsubscribe@maven.apache.org

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