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
--- 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() {