Tibor17 commented on a change in pull request #287:
URL: https://github.com/apache/maven-surefire/pull/287#discussion_r415317010
##########
File path:
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandline.java
##########
@@ -53,19 +56,27 @@ public OutputStreamFlushableCommandline()
public OutputStreamFlushableCommandline( String[]
excludedEnvironmentVariables )
{
this.excludedEnvironmentVariables = new ConcurrentLinkedDeque<>();
+ this.addedEnvironmentVariables = new HashSet<>( );
Collections.addAll( this.excludedEnvironmentVariables,
excludedEnvironmentVariables );
}
+ @Override
+ public void addEnvironment( String name, String value )
+ {
+ super.addEnvironment( name, value );
+ addedEnvironmentVariables.add( name );
+ }
+
@Override
public final void addSystemEnvironment()
{
Properties systemEnvVars = CommandLineUtils.getSystemEnvVars();
for ( String key : systemEnvVars.stringPropertyNames() )
{
- if ( !excludedEnvironmentVariables.contains( key ) )
+ if ( !addedEnvironmentVariables.contains( key ) &&
!excludedEnvironmentVariables.contains( key ) )
Review comment:
yes, this is what I mean. LGTM
----------------------------------------------------------------
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:
[email protected]