# HG changeset patch # User sla # Date 1367311705 -7200 # Node ID 8ee6909f1320d7a176a18e5a59afda9081b6c878 # Parent ef8b87b1597ca895b42da948285113f3fb541ba2 8003671: [findbugs] sun.management.AgentConfigurationError.getParams() may expose internal representation by returning AgentConfigurationError.params Reviewed-by: mchung, rbackman, jbachorik diff -r ef8b87b1597c -r 8ee6909f1320 jdk/src/share/classes/sun/management/AgentConfigurationError.java --- a/jdk/src/share/classes/sun/management/AgentConfigurationError.java Mon Apr 29 22:03:04 2013 -0700 +++ b/jdk/src/share/classes/sun/management/AgentConfigurationError.java Tue Apr 30 10:48:25 2013 +0200 @@ -128,19 +128,13 @@ public AgentConfigurationError(String error, String... params) { super(); this.error = error; - this.params = new String[params.length]; - for (int i = 0; i < params.length; i++) { - this.params[i] = params[i]; - } + this.params = params.clone(); } public AgentConfigurationError(String error, Throwable cause, String... params) { super(cause); this.error = error; - this.params = new String[params.length]; - for (int i = 0; i < params.length; i++) { - this.params[i] = params[i]; - } + this.params = params.clone(); } public String getError() { @@ -148,7 +142,7 @@ } public String[] getParams() { - return params; + return params.clone(); } private static final long serialVersionUID = 1211605593516195475L;