harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r515133 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicScrollBarUI.java test/api/java/common/javax/swing/plaf/basic/BasicScrollBarUITest.java
Date Tue, 06 Mar 2007 14:35:00 GMT
Author: apetrenko
Date: Tue Mar  6 06:34:55 2007
New Revision: 515133

URL: http://svn.apache.org/viewvc?view=rev&rev=515133
Log:
Patch for HARMONY-2852 "[classlib][swing] j.s.plaf.basic.BasicScrollBarUI.PropertyChangeHandler.propertyChange
throws NPE"

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicScrollBarUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicScrollBarUI.java?view=diff&rev=515133&r1=515132&r2=515133
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicScrollBarUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicScrollBarUI.java
Tue Mar  6 06:34:55 2007
@@ -219,8 +219,10 @@
                 }
             }
 
-            scrollbar.revalidate();
-            scrollbar.repaint();
+	    if (scrollbar != null) {	
+                scrollbar.revalidate();
+                scrollbar.repaint();
+            }
         }
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicScrollBarUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicScrollBarUITest.java?view=diff&rev=515133&r1=515132&r2=515133
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicScrollBarUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicScrollBarUITest.java
Tue Mar  6 06:34:55 2007
@@ -24,6 +24,7 @@
 import java.awt.Dimension;
 import java.awt.Frame;
 import java.awt.Rectangle;
+import java.beans.PropertyChangeEvent;
 import javax.swing.BasicSwingTestCase;
 import javax.swing.DefaultBoundedRangeModel;
 import javax.swing.JButton;
@@ -272,5 +273,17 @@
     private void checkIsCloseTo(final int expected, final int actual) {
         assertTrue("expected: " + expected + ", actual: " + actual,
                 Math.abs(expected - actual) <= 2);
+    }
+
+    public void testPropertyChange() {
+        try {            
+            BasicScrollBarUI sbr = new BasicScrollBarUI();
+            BasicScrollBarUI.PropertyChangeHandler h = sbr.new PropertyChangeHandler();
+            final Object object = new Object();
+            PropertyChangeEvent pce = new PropertyChangeEvent(object, "name", object, object);
+            h.propertyChange(pce);
+        } catch (NullPointerException npe) {            
+            fail("NPE thrown");
+        }
     }
 }



Mime
View raw message