From c7d7ed1ee64ee057fc36b444161b0f982cd6e447 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Wed, 6 Aug 2014 19:19:31 +0000 Subject: 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 --- src/java/org/apache/fop/fo/PropertyList.java | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/java/org/apache/fop/fo/PropertyList.java') 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 { -- cgit v1.2.3