changeset 12994:17905e00cda4

8189985: Improve tabular data portability Reviewed-by: dfuchs, robm
author mchinnathamb
date Fri, 16 Feb 2018 01:37:10 -0800
parents d70c21e5b413
children 9cf14f22734a
files src/share/classes/javax/management/openmbean/TabularDataSupport.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/management/openmbean/TabularDataSupport.java	Thu Feb 15 19:03:51 2018 +0000
+++ b/src/share/classes/javax/management/openmbean/TabularDataSupport.java	Fri Feb 16 01:37:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import sun.misc.SharedSecrets;
 
 // jmx import
 //
@@ -911,6 +912,8 @@
             throws IOException, ClassNotFoundException {
       in.defaultReadObject();
       List<String> tmpNames = tabularType.getIndexNames();
-      indexNamesArray = tmpNames.toArray(new String[tmpNames.size()]);
+      int size = tmpNames.size();
+      SharedSecrets.getJavaOISAccess().checkArray(in, String[].class, size);
+      indexNamesArray = tmpNames.toArray(new String[size]);
     }
 }