diff options
author | malenkov <none@none> | 2013-07-16 21:11:54 +0400 |
---|---|---|
committer | malenkov <none@none> | 2013-07-16 21:11:54 +0400 |
commit | 052212dd1ff4f58fc380d45b662b319cae4d01ea (patch) | |
tree | 316289aba53064e07fa6ec09d1b59b630debdfa5 /src/share/classes/javax/swing/text | |
parent | 273dd39d2c3afd2f431cfee9bf5534bc9ac4f093 (diff) |
8019617: Better view of objects
Reviewed-by: art, skoivu
Diffstat (limited to 'src/share/classes/javax/swing/text')
-rw-r--r-- | src/share/classes/javax/swing/text/html/ObjectView.java | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/share/classes/javax/swing/text/html/ObjectView.java b/src/share/classes/javax/swing/text/html/ObjectView.java index 4e43cfb6d..00d3a42c3 100644 --- a/src/share/classes/javax/swing/text/html/ObjectView.java +++ b/src/share/classes/javax/swing/text/html/ObjectView.java @@ -31,6 +31,9 @@ import javax.swing.text.*; import java.beans.*; import java.lang.reflect.*; +import sun.reflect.misc.MethodUtil; +import sun.reflect.misc.ReflectUtil; + /** * Component decorator that implements the view interface * for <object> elements. @@ -87,6 +90,7 @@ public class ObjectView extends ComponentView { AttributeSet attr = getElement().getAttributes(); 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(); @@ -116,28 +120,6 @@ public class ObjectView extends ComponentView { } /** - * Get a Class object to use for loading the - * classid. If possible, the Classloader - * used to load the associated Document is used. - * This would typically be the same as the ClassLoader - * used to load the EditorKit. If the documents - * ClassLoader is null, - * <code>Class.forName</code> is used. - */ - private Class getClass(String classname) throws ClassNotFoundException { - Class klass; - - Class docClass = getDocument().getClass(); - ClassLoader loader = docClass.getClassLoader(); - if (loader != null) { - klass = loader.loadClass(classname); - } else { - klass = Class.forName(classname); - } - return klass; - } - - /** * Initialize this component according the KEY/VALUEs passed in * via the <param> elements in the corresponding * <object> element. @@ -170,7 +152,7 @@ public class ObjectView extends ComponentView { } Object [] args = { value }; try { - writer.invoke(comp, args); + MethodUtil.invoke(writer, comp, args); } catch (Exception ex) { System.err.println("Invocation failed"); // invocation code |