Hey,
This patch fixes a bug in
javax.swing.JRootPane.setLayeredPane(JLayeredPane). If the layered pane
parameter is null, then an IllegalComponentStateException should be
thrown. This fix causes a couple of Harmony's TestSuite tests to pass.
This can be verified in the reference implemenation's API. I have also
committed a mauve test.
Cheers,
Tania
2006-11-22 Tania Bento <[EMAIL PROTECTED]>
* javax/swing/JRootPane.java
(setLayeredPane): Added documentation; throw
IllegalComponentStateException if layered pane parameter is
null.
Index: javax/swing/JRootPane.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JRootPane.java,v
retrieving revision 1.40
diff -u -r1.40 JRootPane.java
--- javax/swing/JRootPane.java 10 May 2006 21:05:01 -0000 1.40
+++ javax/swing/JRootPane.java 22 Nov 2006 20:12:16 -0000
@@ -505,15 +505,21 @@
}
/**
- * DOCUMENT ME!
+ * Set the layered pane for the root pane.
*
- * @param f DOCUMENT ME!
+ * @param f The JLayeredPane to be used.
+ *
+ * @throws IllegalComponentStateException if JLayeredPane
+ * parameter is null.
*/
public void setLayeredPane(JLayeredPane f)
{
+ if (f == null)
+ throw new IllegalComponentStateException();
+
if (layeredPane != null)
remove(layeredPane);
-
+
layeredPane = f;
add(f, -1);
}