harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r518878 - 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 Fri, 16 Mar 2007 07:20:04 GMT
Author: apetrenko
Date: Fri Mar 16 00:20:03 2007
New Revision: 518878

URL: http://svn.apache.org/viewvc?view=rev&rev=518878
Log:
Patch for HARMONY-2853 "[classlib][swing] j.s.plaf.basic.BasicScrollBarUI.configureScrollBarColors()
doesn't throw 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=518878&r1=518877&r2=518878
==============================================================================
--- 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
Fri Mar 16 00:20:03 2007
@@ -279,6 +279,9 @@
     }
 
     protected void configureScrollBarColors() {
+        if (scrollbar == null)
+            throw new NullPointerException();
+            
         if ((thumbColor == null) || (thumbColor instanceof UIResource)) {
             thumbColor = UIManager.getColor("ScrollBar.thumb");
         }

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=518878&r1=518877&r2=518878
==============================================================================
--- 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
Fri Mar 16 00:20:03 2007
@@ -257,6 +257,15 @@
         f.dispose();
     }
 
+    public void testConfigureScrollBarColors() {
+	try {            
+            new BasicScrollBarUI().configureScrollBarColors();
+            fail("NPE expected");
+        } catch (NullPointerException npe) {
+            // PASSED
+        }
+    }
+
     private JFrame createFrame(final JScrollPane pane) throws Exception {
         final JFrame f = new JFrame();
         f.getContentPane().add(pane);



Mime
View raw message