< prev index next >

src/java.management/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java

Print this page

        

@@ -653,11 +653,13 @@
         final Object fromNonNullOpenValue(Object openValue)
                 throws InvalidObjectException {
             final Object[] openArray = (Object[]) openValue;
             final Collection<Object> valueCollection;
             try {
-                valueCollection = cast(collectionClass.newInstance());
+                @SuppressWarnings("deprecation")
+                Collection<?> tmp = collectionClass.newInstance();
+                valueCollection = cast(tmp);
             } catch (Exception e) {
                 throw invalidObjectException("Cannot create collection", e);
             }
             for (Object o : openArray) {
                 Object value = elementMapping.fromOpenValue(o);

@@ -1112,11 +1114,13 @@
                 throws InvalidObjectException {
             Object o;
             try {
                 final Class<?> targetClass = getTargetClass();
                 ReflectUtil.checkPackageAccess(targetClass);
-                o = targetClass.newInstance();
+                @SuppressWarnings("deprecation")
+                Object tmp = targetClass.newInstance();
+                o = tmp;
                 for (int i = 0; i < itemNames.length; i++) {
                     if (cd.containsKey(itemNames[i])) {
                         Object openItem = cd.get(itemNames[i]);
                         Object javaItem =
                             converters[i].fromOpenValue(openItem);
< prev index next >