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 11:45:50 UTC

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

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



##########
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:
       I agree this is a real bug. Rather than fixing it here, perhaps `addEnvironmentVariable` should throw a NullPointerException for null values? 




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