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/01/22 15:01:13 UTC

[GitHub] [maven-shared-utils] slawekjaranowski commented on a change in pull request #68: [MSHARED-969] Environment variable with null value

slawekjaranowski commented on a change in pull request #68:
URL: https://github.com/apache/maven-shared-utils/pull/68#discussion_r562690624



##########
File path: src/main/java/org/apache/maven/shared/utils/cli/Commandline.java
##########
@@ -241,15 +241,16 @@ public void addSystemEnvironment()
     public String[] getEnvironmentVariables()
     {
         addSystemEnvironment();
-        String[] environmentVars = new String[envVars.size()];
-        int i = 0;
+        List<String> environmentVars = new ArrayList<>();
         for ( String name : envVars.keySet() )

Review comment:
       Throwing exception in this case will has impact on caller, eg has impact on https://issues.apache.org/jira/browse/MINVOKER-273
   
   In my proposition we have new feature - when environment variable has null value will be removed from executing job environment.
   
   Look at unit tests.
   
   Different approach can be  throw exception for null values and add next method to possibility remove/exclude specific environment variables.
   
   
   




----------------------------------------------------------------
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.

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