Simplifies when map should be unmodifiable
Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/7f3defd6 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/7f3defd6 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/7f3defd6 Branch: refs/heads/master Commit: 7f3defd67d9ce8074576ed792f5122193f31a29f Parents: 1f5c197 Author: Lukasz Lenart <lukaszlen...@apache.org> Authored: Wed Aug 17 16:59:51 2016 +0200 Committer: Lukasz Lenart <lukaszlen...@apache.org> Committed: Wed Aug 17 16:59:51 2016 +0200 ---------------------------------------------------------------------- .../opensymphony/xwork2/config/entities/ResultTypeConfig.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/7f3defd6/core/src/main/java/com/opensymphony/xwork2/config/entities/ResultTypeConfig.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/com/opensymphony/xwork2/config/entities/ResultTypeConfig.java b/core/src/main/java/com/opensymphony/xwork2/config/entities/ResultTypeConfig.java index 65f6c29..a32ebca 100644 --- a/core/src/main/java/com/opensymphony/xwork2/config/entities/ResultTypeConfig.java +++ b/core/src/main/java/com/opensymphony/xwork2/config/entities/ResultTypeConfig.java @@ -69,7 +69,7 @@ public class ResultTypeConfig extends Located implements Serializable { } public Map<String,String> getParams() { - return this.params; + return Collections.unmodifiableMap(this.params); } @Override @@ -148,14 +148,9 @@ public class ResultTypeConfig extends Located implements Serializable { } public ResultTypeConfig build() { - embalmTarget(); ResultTypeConfig result = target; target = new ResultTypeConfig(target); return result; } - - protected void embalmTarget() { - target.params = Collections.unmodifiableMap(target.params); - } } }