8026176: Enhance document printing
authorprr
Mon, 14 Oct 2013 16:13:20 -0700
changeset 22326 2fb1fdf0e74e
parent 22325 f22d936a0ff5
child 22327 0939d1a7e612
8026176: Enhance document printing Reviewed-by: bae, jgodinez
jdk/src/share/classes/javax/print/SimpleDoc.java
--- a/jdk/src/share/classes/javax/print/SimpleDoc.java	Sat Oct 12 20:46:35 2013 -0700
+++ b/jdk/src/share/classes/javax/print/SimpleDoc.java	Mon Oct 14 16:13:20 2013 -0700
@@ -91,7 +91,10 @@
 
        Class repClass = null;
        try {
-            repClass = Class.forName(flavor.getRepresentationClassName());
+            String className = flavor.getRepresentationClassName();
+            sun.reflect.misc.ReflectUtil.checkPackageAccess(className);
+            repClass = Class.forName(className, false,
+                              Thread.currentThread().getContextClassLoader());
        } catch (Throwable e) {
            throw new IllegalArgumentException("unknown representation class");
        }