harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r489356 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicComboBoxUI.java test/api/java/common/javax/swing/plaf/basic/BasicComboBoxUITest.java
Date Thu, 21 Dec 2006 13:59:59 GMT
Author: apetrenko
Date: Thu Dec 21 05:59:58 2006
New Revision: 489356

URL: http://svn.apache.org/viewvc?view=rev&rev=489356
Log:
Patch for HARMONY-1749 "[classlib][swing] BasicComboBoxUI.removeEditor() throws unspecified
NPE"

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicComboBoxUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicComboBoxUI.java?view=diff&rev=489356&r1=489355&r2=489356
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicComboBoxUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicComboBoxUI.java
Thu Dec 21 05:59:58 2006
@@ -369,9 +369,11 @@
     }
 
     public void removeEditor() {
-        comboBox.remove(editor);
-        unconfigureEditor();
-        editor = null;
+        if (editor != null){
+            comboBox.remove(editor);
+            unconfigureEditor();
+            editor = null;
+        }
     }
 
     public boolean isPopupVisible(final JComboBox c) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicComboBoxUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicComboBoxUITest.java?view=diff&rev=489356&r1=489355&r2=489356
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicComboBoxUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicComboBoxUITest.java
Thu Dec 21 05:59:58 2006
@@ -468,6 +468,12 @@
         assertEquals(newRenderer, ui.popup.getList().getCellRenderer());
     }
 
+    public void testRemove_NullEditor() throws Exception{
+        // Regression test for Harmony-1749
+        BasicComboBoxUI cb = new BasicComboBoxUI();
+        cb.removeEditor();
+    }
+    
     @SuppressWarnings("deprecation")
     private void createVisibleCombo() {
         frame.getContentPane().add(comboBox);



Mime
View raw message