]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Simplified implementation of Area.getTraitAsBoolean()
authorAndreas L. Delmelle <adelmelle@apache.org>
Sun, 6 Jul 2008 08:46:50 +0000 (08:46 +0000)
committerAndreas L. Delmelle <adelmelle@apache.org>
Sun, 6 Jul 2008 08:46:50 +0000 (08:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@674273 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/area/Area.java

index d656b7b7d6feb84e22884548adad737dd2b11a3d..30911700fcf21b972b00d195d794cae6e038585e 100644 (file)
@@ -415,17 +415,11 @@ public class Area extends AreaTreeObject implements Serializable {
     
     /**
      * Get a boolean trait from this area.
-     * 
      * @param oTraitCode the trait key
      * @return the trait value
      */
     public boolean getTraitAsBoolean(Object oTraitCode) {
-        final Object obj = getTrait(oTraitCode);
-        if (obj instanceof Boolean) {
-            return ((Boolean)obj).booleanValue();
-        } else {
-            return false;
-        }
+        return Boolean.TRUE.equals(getTrait(oTraitCode));
     }
 
     /**