提交 850420b6 编写于 作者: X xuelei

8005598: (reopened) Need to clone array of input/output parameters

Reviewed-by: weijun
上级 e3b4af2f
...@@ -102,7 +102,7 @@ public class DnsContext extends ComponentDirContext { ...@@ -102,7 +102,7 @@ public class DnsContext extends ComponentDirContext {
this.domain = new DnsName(domain.endsWith(".") this.domain = new DnsName(domain.endsWith(".")
? domain ? domain
: domain + "."); : domain + ".");
this.servers = servers; this.servers = (servers == null) ? null : servers.clone();
this.environment = (Hashtable<Object,Object>) environment.clone(); this.environment = (Hashtable<Object,Object>) environment.clone();
envShared = false; envShared = false;
parentIsDns = false; parentIsDns = false;
...@@ -129,11 +129,11 @@ public class DnsContext extends ComponentDirContext { ...@@ -129,11 +129,11 @@ public class DnsContext extends ComponentDirContext {
* no conflict. * no conflict.
*/ */
private DnsContext(DnsContext ctx) { private DnsContext(DnsContext ctx) {
environment = ctx.environment; environment = ctx.environment; // shared environment, copy-on-write
envShared = ctx.envShared = true; envShared = ctx.envShared = true;
parentIsDns = ctx.parentIsDns; parentIsDns = ctx.parentIsDns;
domain = ctx.domain; domain = ctx.domain;
servers = ctx.servers; servers = ctx.servers; // shared servers, no write operation
resolver = ctx.resolver; resolver = ctx.resolver;
authoritative = ctx.authoritative; authoritative = ctx.authoritative;
recursion = ctx.recursion; recursion = ctx.recursion;
......
...@@ -81,7 +81,7 @@ public class BasicControl implements Control { ...@@ -81,7 +81,7 @@ public class BasicControl implements Control {
this.id = id; this.id = id;
this.criticality = criticality; this.criticality = criticality;
if (value != null) { if (value != null) {
this.value = value; this.value = value.clone();
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册