Hey,

This patch fixes a bug in javax.swing.border.CompoundBorder's
isBorderOpaque() method.  The reference implementation specifications
states that this method only returns true if both the inside and outside
borders have a non-null value and both are opaque; false, otherwise.
However, the mauve test I just committed
(gnu.testlet.javax.swing.border.CompoundBorder.isBorderOpaque) shows
that if both the inside and outside borders are null, then true is
returned.  This patch fixes a failing Harmony test.

Cheers,
Tania

2006-12-06  Tania Bento  <[EMAIL PROTECTED]>

        * javax/swing/border/CompoundBorder.java:
        (isBorderOpaque): If inside and outside border both have a null
        value, return true.

Index: javax/swing/border/CompoundBorder.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/border/CompoundBorder.java,v
retrieving revision 1.12
diff -u -r1.12 CompoundBorder.java
--- javax/swing/border/CompoundBorder.java	17 May 2006 21:06:51 -0000	1.12
+++ javax/swing/border/CompoundBorder.java	6 Dec 2006 15:04:44 -0000
@@ -115,6 +115,13 @@
    */
   public boolean 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;
+    
     // 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

Reply via email to