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/FOPropertyMapping.java | 1 + src/java/org/apache/fop/fo/PropertyList.java | 22 ++++++++++------------ .../apache/fop/fo/extensions/svg/SVGElement.java | 3 --- .../fop/fo/properties/CommonTextDecoration.java | 5 ++--- .../fop/fo/properties/ToBeImplementedProperty.java | 3 ++- 5 files changed, 15 insertions(+), 19 deletions(-) (limited to 'src/java/org/apache/fop/fo') diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java index 413438c16..9089304df 100644 --- a/src/java/org/apache/fop/fo/FOPropertyMapping.java +++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java @@ -343,6 +343,7 @@ public final class FOPropertyMapping implements Constants { addSubpropMakerName("precedence", CP_PRECEDENCE); } + // SuppressFBWarnings("MS_EXPOSE_REP") return generics; } 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 { diff --git a/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java b/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java index eac8338aa..63506dd0a 100644 --- a/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java +++ b/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java @@ -130,9 +130,6 @@ public class SVGElement extends SVGObj { public float getFontSize() { return 12; } - - public void deselectAll() { - } }; SVGOMElement e = (SVGOMElement)svgRoot; e.setSVGContext(dc); diff --git a/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java b/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java index 8ef62ced0..7f843279e 100644 --- a/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java +++ b/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java @@ -64,6 +64,7 @@ public class CommonTextDecoration { private static CommonTextDecoration calcTextDecoration(PropertyList pList) throws PropertyException { + assert pList != null; CommonTextDecoration deco = null; PropertyList parentList = pList.getParentPropertyList(); if (parentList != null) { @@ -78,9 +79,7 @@ public class CommonTextDecoration { while (i.hasNext()) { Property prop = (Property)i.next(); int propEnum = prop.getEnum(); - FOUserAgent ua = (pList == null) - ? null - : (pList.getFObj() == null ? null : pList.getFObj().getUserAgent()); + FOUserAgent ua = pList.getFObj() == null ? null : pList.getFObj().getUserAgent(); if (propEnum == Constants.EN_NONE) { if (deco != null) { deco.decoration = 0; diff --git a/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java b/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java index 0315e0e74..6c820eeab 100644 --- a/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java +++ b/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java @@ -74,11 +74,12 @@ public class ToBeImplementedProperty extends Property { @Override public boolean equals(Object obj) { - return true; /* * Since a PropertyCache is not used here, returning true helps the PropertyCache when a non * implemented property is part of an implemented one. */ + // FBOFF: EQ_ALWAYS_TRUE + return true; } } -- cgit v1.2.3