changeset 6874:aef5cd4ac081

8026176: Enhance document printing Reviewed-by: bae, jgodinez
author prr
date Tue, 15 Oct 2013 11:34:38 -0700
parents 0797c957fdb9
children 2197764aee8b
files src/share/classes/javax/print/SimpleDoc.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/print/SimpleDoc.java	Tue Oct 15 09:32:07 2013 -0700
+++ b/src/share/classes/javax/print/SimpleDoc.java	Tue Oct 15 11:34:38 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");
        }