< prev index next >

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

Print this page

        

*** 653,663 **** final Object fromNonNullOpenValue(Object openValue) throws InvalidObjectException { final Object[] openArray = (Object[]) openValue; final Collection<Object> valueCollection; try { ! valueCollection = cast(collectionClass.newInstance()); } catch (Exception e) { throw invalidObjectException("Cannot create collection", e); } for (Object o : openArray) { Object value = elementMapping.fromOpenValue(o); --- 653,665 ---- final Object fromNonNullOpenValue(Object openValue) throws InvalidObjectException { final Object[] openArray = (Object[]) openValue; final Collection<Object> valueCollection; try { ! @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,1122 **** throws InvalidObjectException { Object o; try { final Class<?> targetClass = getTargetClass(); ReflectUtil.checkPackageAccess(targetClass); ! o = targetClass.newInstance(); 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); --- 1114,1126 ---- throws InvalidObjectException { Object o; try { final Class<?> targetClass = getTargetClass(); ReflectUtil.checkPackageAccess(targetClass); ! @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 >