8162702: com.sun.management.internal.GcInfoBuilder.getPoolNames should not return reference of it's private member
authordsamersoff
Mon, 01 Aug 2016 15:27:07 +0300
changeset 40200 80c101dbb38d
parent 40199 1795251e7dec
child 40202 ce2b94b9d36b
8162702: com.sun.management.internal.GcInfoBuilder.getPoolNames should not return reference of it's private member Summary: return clone of array Reviewed-by: dholmes, hb, dsamersoff Contributed-by: amit.sapre@oracle.com
jdk/src/jdk.management/share/classes/com/sun/management/internal/GcInfoBuilder.java
--- a/jdk/src/jdk.management/share/classes/com/sun/management/internal/GcInfoBuilder.java	Mon Aug 01 13:53:55 2016 +0300
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/internal/GcInfoBuilder.java	Mon Aug 01 15:27:07 2016 +0300
@@ -79,7 +79,7 @@
     }
 
     public String[] getPoolNames() {
-        return poolNames;
+        return poolNames.clone();
     }
 
     int getGcExtItemCount() {