diff options
author | Glenn Adams <gadams@apache.org> | 2012-04-08 00:08:50 +0000 |
---|---|---|
committer | Glenn Adams <gadams@apache.org> | 2012-04-08 00:08:50 +0000 |
commit | 5a544f931a6081f42bbdb4bb1465f3c3c6318af1 (patch) | |
tree | be254e851016ac197988194f3e1352d0dac825ea | |
parent | a93ce40b9a41760b54fde89f3e8b31d924c866f6 (diff) | |
download | xmlgraphics-fop-5a544f931a6081f42bbdb4bb1465f3c3c6318af1.tar.gz xmlgraphics-fop-5a544f931a6081f42bbdb4bb1465f3c3c6318af1.zip |
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
-rw-r--r-- | src/java/org/apache/fop/fo/properties/PropertyCache.java | 30 | ||||
-rw-r--r-- | 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<T> { * (case insensitive). */ public PropertyCache() { - this.useCache = Boolean.valueOf( - System.getProperty("org.apache.fop.fo.properties.use-cache", "true")) - .booleanValue(); - if (useCache) { - map = new ConcurrentHashMap<Integer, WeakReference<T>>(); - 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<Integer, WeakReference<T>>(); + 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. --> <release version="FOP Trunk" date="TBD"> + <action context="Code" dev="GA" type="fix" fixes-bug="50435" due-to="Armin Haaf"> + Access denied (java.util.PropertyPermission org.apache.fop.fo.properties.use-cache read). + </action> <action context="Code" dev="GA" type="fix" fixes-bug="49763" due-to="Adrian Buza"> Incorrect message when encountering a block in an inline in a footnote. </action> |