diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-11-24 20:08:56 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-11-24 20:08:56 +0000 |
commit | 5f552c3c17b11d61d011ec0202b94e8cf3cb35f1 (patch) | |
tree | 2be3d64627552bbce7a214c3208bfc851b77b71e /src/java/org/apache/fop/fo/FObj.java | |
parent | 2712c9529bb41fa2cb7fd4443ad3af4758239b90 (diff) | |
download | xmlgraphics-fop-5f552c3c17b11d61d011ec0202b94e8cf3cb35f1.tar.gz xmlgraphics-fop-5f552c3c17b11d61d011ec0202b94e8cf3cb35f1.zip |
Bugfix for a multi-threading problem:
propertyListTable initialization moved from the constructor to a static block in FOObj.
This fixes NullPointerExceptions in PropertyList.
This was discovered using the application in test/java/org/apache/fop/threading/.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@348795 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/FObj.java')
-rw-r--r-- | src/java/org/apache/fop/fo/FObj.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index 72a8b5d5d..fb6bf0820 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -55,12 +55,21 @@ public abstract class FObj extends FONode implements Constants { /** Markers added to this element. */ protected Map markers = null; + static { + propertyListTable = new PropertyMaker[Constants.PROPERTY_COUNT + 1]; + PropertyMaker[] list = FOPropertyMapping.getGenericMappings(); + for (int i = 1; i < list.length; i++) { + if (list[i] != null) { + propertyListTable[i] = list[i]; + } + } + } + /** * Create a new formatting object. * All formatting object classes extend this class. * * @param parent the parent node - * @todo move propertyListTable initialization someplace else? */ public FObj(FONode parent) { super(parent); @@ -77,16 +86,6 @@ public abstract class FObj extends FONode implements Constants { } } } - - if (propertyListTable == null) { - propertyListTable = new PropertyMaker[Constants.PROPERTY_COUNT + 1]; - PropertyMaker[] list = FOPropertyMapping.getGenericMappings(); - for (int i = 1; i < list.length; i++) { - if (list[i] != null) { - propertyListTable[i] = list[i]; - } - } - } } /** |