< prev index next >

src/java.desktop/share/classes/javax/swing/text/html/ObjectView.java

Print this page

        

*** 44,54 **** * used to load the EditorKit. If the document's * ClassLoader is null, <code>Class.forName</code> is used. * <p> * If the class can successfully be loaded, an attempt will * be made to create an instance of it by calling ! * <code>Class.newInstance</code>. An attempt will be made * to narrow the instance to type <code>java.awt.Component</code> * to display the object. * <p> * This view can also manage a set of parameters with limitations. * The parameters to the &lt;object&gt; element are expected to --- 44,54 ---- * used to load the EditorKit. If the document's * ClassLoader is null, <code>Class.forName</code> is used. * <p> * If the class can successfully be loaded, an attempt will * be made to create an instance of it by calling ! * <code>Class.getDeclaredConstructor().newInstance</code>. An attempt will be made * to narrow the instance to type <code>java.awt.Component</code> * to display the object. * <p> * This view can also manage a set of parameters with limitations. * The parameters to the &lt;object&gt; element are expected to
*** 90,100 **** String classname = (String) attr.getAttribute(HTML.Attribute.CLASSID); try { ReflectUtil.checkPackageAccess(classname); Class<?> c = Class.forName(classname, true,Thread.currentThread(). getContextClassLoader()); ! Object o = c.newInstance(); if (o instanceof Component) { Component comp = (Component) o; setParameters(comp, attr); return comp; } --- 90,100 ---- String classname = (String) attr.getAttribute(HTML.Attribute.CLASSID); try { ReflectUtil.checkPackageAccess(classname); Class<?> c = Class.forName(classname, true,Thread.currentThread(). getContextClassLoader()); ! Object o = c.getDeclaredConstructor().newInstance(); if (o instanceof Component) { Component comp = (Component) o; setParameters(comp, attr); return comp; }
< prev index next >