8293717: Objective view of ObjectView

Reviewed-by: bae
Backport-of: fb692840530fa07174f9ad5c9f77d593e503a155
This commit is contained in:
Yuri Nesterenko 2022-10-28 14:23:52 +03:00
parent ac174fa9b1
commit f184313068

View File

@ -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