aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/PropertyList.java
diff options
context:
space:
mode:
authorGlenn Adams <gadams@apache.org>2014-08-06 19:19:31 +0000
committerGlenn Adams <gadams@apache.org>2014-08-06 19:19:31 +0000
commitc7d7ed1ee64ee057fc36b444161b0f982cd6e447 (patch)
treef57d2a3f0d3bd9f9a40aad9d735e160a9d867c6f /src/java/org/apache/fop/fo/PropertyList.java
parentd408d2b45d6487f194eeb153830cd8b3ef479c92 (diff)
downloadxmlgraphics-fop-c7d7ed1ee64ee057fc36b444161b0f982cd6e447.tar.gz
xmlgraphics-fop-c7d7ed1ee64ee057fc36b444161b0f982cd6e447.zip
Fix or suppress 1-instance findbug warnings.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1616312 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/PropertyList.java')
-rw-r--r--src/java/org/apache/fop/fo/PropertyList.java22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/java/org/apache/fop/fo/PropertyList.java b/src/java/org/apache/fop/fo/PropertyList.java
index 2f4d16480..0412091a5 100644
--- a/src/java/org/apache/fop/fo/PropertyList.java
+++ b/src/java/org/apache/fop/fo/PropertyList.java
@@ -52,9 +52,17 @@ import org.apache.fop.fo.properties.PropertyMaker;
*/
public abstract class PropertyList {
-
private static boolean[] inheritableProperty;
+ static {
+ inheritableProperty = new boolean[Constants.PROPERTY_COUNT + 1];
+ PropertyMaker maker = null;
+ for (int prop = 1; prop <= Constants.PROPERTY_COUNT; prop++) {
+ maker = findMaker(prop);
+ inheritableProperty[prop] = (maker != null && maker.isInherited());
+ }
+ }
+
/** reference to the parent FO's propertyList **/
protected PropertyList parentPropertyList;
private FObj fobj;
@@ -620,15 +628,6 @@ public abstract class PropertyList {
* @return isInherited value from the requested Property.Maker
*/
private boolean isInherited(int propId) {
- if (inheritableProperty == null) {
- inheritableProperty = new boolean[Constants.PROPERTY_COUNT + 1];
- PropertyMaker maker = null;
- for (int prop = 1; prop <= Constants.PROPERTY_COUNT; prop++) {
- maker = findMaker(prop);
- inheritableProperty[prop] = (maker != null && maker.isInherited());
- }
- }
-
return inheritableProperty[propId];
}
@@ -636,8 +635,7 @@ public abstract class PropertyList {
* @param propId Id of property
* @return the Property.Maker for this property
*/
- private PropertyMaker findMaker(int propId) {
-
+ private static PropertyMaker findMaker(int propId) {
if (propId < 1 || propId > Constants.PROPERTY_COUNT) {
return null;
} else {