8293717: Objective view of ObjectView

Reviewed-by: kizune, rhalade, prr, azvegint, skoivu
This commit is contained in:
Prasanta Sadhukhan 2022-09-29 07:39:29 +00:00 committed by Henry Jen
parent 3364c460a4
commit d6b1513233

@ -91,13 +91,15 @@ public class ObjectView extends ComponentView {
String classname = (String) attr.getAttribute(HTML.Attribute.CLASSID);
try {
ReflectUtil.checkPackageAccess(classname);
Class<?> c = Class.forName(classname, true,Thread.currentThread().
Class<?> c = Class.forName(classname, false,Thread.currentThread().
getContextClassLoader());
Object o = c.newInstance();
if (o instanceof Component) {
Component comp = (Component) o;
setParameters(comp, attr);
return comp;
if (Component.class.isAssignableFrom(c)) {
Object o = c.newInstance();
if (o instanceof Component) {
Component comp = (Component) o;
setParameters(comp, attr);
return comp;
}
}
} catch (Throwable e) {
// couldn't create a component... fall through to the