harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r515561 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicRadioButtonUI.java test/api/java/common/javax/swing/plaf/basic/BasicCheckBoxUITest.java
Date Wed, 07 Mar 2007 13:35:04 GMT
Author: ayza
Date: Wed Mar  7 05:35:03 2007
New Revision: 515561

URL: http://svn.apache.org/viewvc?view=rev&rev=515561
Log:
Applying patch from HARMONY-2605 ([classlib][swing][plaf] javax.swing.plaf.basic.BasicCheckBoxUI.getMaximumSize(...)
throws unexpected ClassCastException)

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicRadioButtonUI.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicCheckBoxUITest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicRadioButtonUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicRadioButtonUI.java?view=diff&rev=515561&r1=515560&r2=515561
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicRadioButtonUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicRadioButtonUI.java
Wed Mar  7 05:35:03 2007
@@ -77,7 +77,11 @@
     }
 
     public Dimension getPreferredSize(final JComponent c) {
-        return ButtonCommons.getPreferredSize((AbstractButton)c, getDefaultIcon());
+        if (c instanceof AbstractButton) {
+            return ButtonCommons.getPreferredSize((AbstractButton) c, getDefaultIcon());
+        } else {
+            return null;
+        }
     }
 
     protected void paintIcon(final Graphics g, final JComponent c, final Rectangle iconRect)
{

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicCheckBoxUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicCheckBoxUITest.java?view=diff&rev=515561&r1=515560&r2=515561
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicCheckBoxUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicCheckBoxUITest.java
Wed Mar  7 05:35:03 2007
@@ -32,6 +32,7 @@
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
+import javax.swing.JScrollBar;
 import javax.swing.SwingTestCase;
 import javax.swing.UIManager;
 import javax.swing.border.Border;
@@ -122,6 +123,9 @@
         assertEquals("PreferredSize", new Dimension(horInsets + iconW + textWidth
                 + button1.getIconTextGap(), vertInsets + Math.max(iconH, textHeight)), ui
                 .getPreferredSize(button6));
+
+        // regression test for HARMONY-2605
+        assertNull(new BasicCheckBoxUI().getMaximumSize(new JScrollBar()));
     }
 
     public void testCreateUI() {



Mime
View raw message