diff options
Diffstat (limited to 'libjava/classpath/javax/swing/border/CompoundBorder.java')
-rw-r--r-- | libjava/classpath/javax/swing/border/CompoundBorder.java | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/libjava/classpath/javax/swing/border/CompoundBorder.java b/libjava/classpath/javax/swing/border/CompoundBorder.java index 2ee639cf9a3..ba2e745aab5 100644 --- a/libjava/classpath/javax/swing/border/CompoundBorder.java +++ b/libjava/classpath/javax/swing/border/CompoundBorder.java @@ -115,15 +115,24 @@ public class CompoundBorder extends AbstractBorder */ public boolean isBorderOpaque() { - // While it would be safe to assume true for the opacity of - // a null border, this behavior would not be according to - // the API specification. Also, it is pathological to have - // null borders anyway. - if ((insideBorder == null) || (outsideBorder == null)) - return false; - - return insideBorder.isBorderOpaque() - && outsideBorder.isBorderOpaque(); + // Although the API specification states that this method + // returns true if both the inside and outside borders are non-null + // and opaque, and false otherwise, a mauve test shows that if both + // the inside or outside borders are null, then true is returned. + if ((insideBorder == null) && (outsideBorder == null)) + return true; + + // A mauve test shows that if the inside border has a null value, + // then true is returned if the outside border is opaque; if the + // outside border has a null value, then true is returned if the + // inside border is opaque; else, true is returned if both the + // inside and outside borders are opaque. + if (insideBorder == null) + return outsideBorder.isBorderOpaque(); + else if (outsideBorder == null) + return insideBorder.isBorderOpaque(); + else + return insideBorder.isBorderOpaque() && outsideBorder.isBorderOpaque(); } /** |