Hey,
On Wed, 2006-12-06 at 12:51 -0500, Tania Bento wrote:
> Hi David,
>
> On Wed, 2006-12-06 at 16:39 +0000, David Gilbert wrote:
> > Hi Tania,
> >
> > It is a good idea to report such problems (in the specification) to
> > Sun. Although, this one has already been reported:
> >
> > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4778988
>
> Thanks for the info. I actually was about ready to commit a patch
> similar to the code in the above bug report. I wrote some more mauve
> tests and realized that my previous patch didn't cover all situations.
> Should I go ahead and commit it, or should I just wait it off until the
> class library code is available?
>
> Cheers,
> Tania
I actually just spoke to Tom on IRC and he told me to commit it as long
as I wrote it on my own. Since I did, here is the patch. The ChangeLog
explains the changes. I have committed mauve tests for these changes.
Cheers,
Tania
2006-12-06 Tania Bento <[EMAIL PROTECTED]>
* javax/swing/border/CompoundBorder.java:
(isBorderOpaque): If inside border is null, return true if
outside
border is opaque, false otherwise; if outside border is null,
return
true if inside border is opaque, false otherwise; if inside or
outside border are both not null, then return true only if both
the
inside and outside border are opaque, false otherwise.
Index: javax/swing/border/CompoundBorder.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/border/CompoundBorder.java,v
retrieving revision 1.13
diff -u -r1.13 CompoundBorder.java
--- javax/swing/border/CompoundBorder.java 6 Dec 2006 15:19:00 -0000 1.13
+++ javax/swing/border/CompoundBorder.java 6 Dec 2006 18:23:04 -0000
@@ -121,16 +121,18 @@
// 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
- // null borders anyway.
- if ((insideBorder == null) || (outsideBorder == null))
- return false;
- return insideBorder.isBorderOpaque()
- && outsideBorder.isBorderOpaque();
+ // 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();
}
/**