harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496264 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicSliderUI.java test/api/java/common/javax/swing/plaf/basic/BasicSliderUITest.java
Date Mon, 15 Jan 2007 09:47:12 GMT
Author: hindessm
Date: Mon Jan 15 01:47:11 2007
New Revision: 496264

URL: http://svn.apache.org/viewvc?view=rev&rev=496264
Log:
Applying patches from "[#HARMONY-2878] [classlib][swing]
j.s.plaf.basic.BasicSliderUI.createScrollListener throws unspecified NPE".

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java?view=diff&rev=496264&r1=496263&r2=496264
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java
Mon Jan 15 01:47:11 2007
@@ -466,8 +466,9 @@
     }
 
     protected ScrollListener createScrollListener(final JSlider slider) {
-        this.slider = slider;
-        return new ScrollListener(slider.getOrientation(), slider.getSnapToTicks());
+        return slider != null
+               ? new ScrollListener(slider.getOrientation(), slider.getSnapToTicks())
+               : new ScrollListener();
     }
 
     protected PropertyChangeListener createPropertyChangeListener(final JSlider slider) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicSliderUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicSliderUITest.java?view=diff&rev=496264&r1=496263&r2=496264
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicSliderUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicSliderUITest.java
Mon Jan 15 01:47:11 2007
@@ -111,6 +111,11 @@
                 .createScrollListener(slider));
     }
 
+    // Regression for HARMONY-2878
+    public void testCreateScrollListenerNull() throws Exception {
+        assertNotNull(sliderUI.createScrollListener(null)); // no exception expected
+    }
+
     public void testCreatePropertyChangeListener() throws Exception {
         assertNotNull(sliderUI.createPropertyChangeListener(slider));
         assertFalse(sliderUI.createPropertyChangeListener(slider) == sliderUI



Mime
View raw message