From 5a544f931a6081f42bbdb4bb1465f3c3c6318af1 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Sun, 8 Apr 2012 00:08:50 +0000 Subject: [PATCH] Bugzilla #50435: Access denied (java.util.PropertyPermission org.apache.fop.fo.properties.use-cache read). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1310924 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/fo/properties/PropertyCache.java | 30 +++++++++++-------- status.xml | 3 ++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/java/org/apache/fop/fo/properties/PropertyCache.java b/src/java/org/apache/fop/fo/properties/PropertyCache.java index d08164b6c..76ed35d76 100644 --- a/src/java/org/apache/fop/fo/properties/PropertyCache.java +++ b/src/java/org/apache/fop/fo/properties/PropertyCache.java @@ -76,20 +76,26 @@ public final class PropertyCache { * (case insensitive). */ public PropertyCache() { - this.useCache = Boolean.valueOf( - System.getProperty("org.apache.fop.fo.properties.use-cache", "true")) - .booleanValue(); - if (useCache) { - map = new ConcurrentHashMap>(); - putCounter = new AtomicInteger(); - cleanupLock = new ReentrantLock(); - hashCodeCollisionCounter = new AtomicInteger(); + boolean useCache; + try { + useCache = Boolean.valueOf( + System.getProperty("org.apache.fop.fo.properties.use-cache", "true")) + .booleanValue(); + } catch ( SecurityException e ) { + useCache = false; + } + if ( useCache ) { + this.map = new ConcurrentHashMap>(); + this.putCounter = new AtomicInteger(); + this.cleanupLock = new ReentrantLock(); + this.hashCodeCollisionCounter = new AtomicInteger(); } else { - map = null; - putCounter = null; - cleanupLock = null; - hashCodeCollisionCounter = null; + this.map = null; + this.putCounter = null; + this.cleanupLock = null; + this.hashCodeCollisionCounter = null; } + this.useCache = useCache; } /** diff --git a/status.xml b/status.xml index 140016156..a647cee7d 100644 --- a/status.xml +++ b/status.xml @@ -62,6 +62,9 @@ documents. Example: the fix of marks layering will be such a case when it's done. --> + + Access denied (java.util.PropertyPermission org.apache.fop.fo.properties.use-cache read). + Incorrect message when encountering a block in an inline in a footnote. -- 2.39.5