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



##########
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:
       Well, this is a matter of taste IMHO and we had chat about this with 
@michael-o as well.
   I see value of interfaces only at "public surfaces" (like non-private method 
parameters and return values). For method local variables (and private members) 
I tend to always do it like this:
   ```
   public method int doSomethig() {
     HashMap<T1, T2> tempMap = new HashMap<>();
     ...
     return tempMap.size();
   }
   ```
   doing it as `Map<T1, T2> tempMap = new HashMap<>();` would be just 2 imports 
vs 1 import w/o any real benefit.
   
   In this case, `parameters` is internal matter of this class. Nowhere is 
directly exposed (just a copy of it), so IMHO it is completely it's own matter. 
What benefit would be gained here by using interface?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to