提交 e973dae3 编写于 作者: J Jerome Lacoste 提交者: Kohsuke Kawaguchi

MavenBuilders: also disallow setting system properties with empty keys

上级 4ee8d689
......@@ -113,8 +113,10 @@ public class Maven3Builder extends AbstractMavenBuilder implements DelegatingCal
markAsSuccess = false;
// working around NPE when someone puts a null value into systemProps.
// working around NPE when someone puts a null value or empty keys into systemProps.
for (Map.Entry<String,String> e : systemProps.entrySet()) {
if ("".equals(e.getKey()))
throw new IllegalArgumentException("System property has an empty key");
if (e.getValue()==null)
throw new IllegalArgumentException("System property "+e.getKey()+" has a null value");
System.getProperties().put(e.getKey(), e.getValue());
......
......@@ -154,8 +154,10 @@ public abstract class MavenBuilder extends AbstractMavenBuilder implements Deleg
markAsSuccess = false;
// working around NPE when someone puts a null value into systemProps.
// working around NPE when someone puts a null value or empty keys into systemProps.
for (Map.Entry<String,String> e : systemProps.entrySet()) {
if ("".equals(e.getKey()))
throw new IllegalArgumentException("System property has an empty key");
if (e.getValue()==null)
throw new IllegalArgumentException("System property "+e.getKey()+" has a null value");
System.getProperties().put(e.getKey(), e.getValue());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册