@@ -76,8 +76,14 @@ public static class Execution extends AbstractStepExecutionImpl {
7676 }
7777
7878 @ Override public boolean start () throws Exception {
79+ Map <String , String > overridesM = new HashMap <>();
80+ for (String pair : overrides ) {
81+ int split = pair .indexOf ('=' );
82+ assert split != -1 ;
83+ overridesM .put (pair .substring (0 , split ), pair .substring (split + 1 ));
84+ }
7985 getContext ().newBodyInvoker ().
80- withContext (EnvironmentExpander .merge (getContext ().get (EnvironmentExpander .class ), new ExpanderImpl ( overrides ))).
86+ withContext (EnvironmentExpander .merge (getContext ().get (EnvironmentExpander .class ), EnvironmentExpander . constant ( overridesM ))).
8187 withCallback (BodyExecutionCallback .wrap (getContext ())).
8288 start ();
8389 return false ;
@@ -90,18 +96,11 @@ public static class Execution extends AbstractStepExecutionImpl {
9096 @ Override public void onResume () {}
9197
9298 }
93-
99+
100+ @ Deprecated // kept only for serial compatibility
94101 private static final class ExpanderImpl extends EnvironmentExpander {
95102 private static final long serialVersionUID = 1 ;
96- private final Map <String ,String > overrides ;
97- private ExpanderImpl (List <String > overrides ) {
98- this .overrides = new HashMap <>();
99- for (String pair : overrides ) {
100- int split = pair .indexOf ('=' );
101- assert split != -1 ;
102- this .overrides .put (pair .substring (0 , split ), pair .substring (split + 1 ));
103- }
104- }
103+ private Map <String ,String > overrides ;
105104 @ Override public void expand (EnvVars env ) throws IOException , InterruptedException {
106105 env .overrideAll (overrides );
107106 }
0 commit comments