harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r517707 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI.java test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUITest.java
Date Tue, 13 Mar 2007 14:34:18 GMT
Author: apetrenko
Date: Tue Mar 13 07:34:17 2007
New Revision: 517707

URL: http://svn.apache.org/viewvc?view=rev&rev=517707
Log:
Patch for HARMONY-1804 "[classlib][swing] javax.swing.plaf.basic.BasicTabbedPaneUI.paint(Graphics
g, JComponent c) does not throw NullPointerException when g is null while RI does"

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI.java?view=diff&rev=517707&r1=517706&r2=517707
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI.java
Tue Mar 13 07:34:17 2007
@@ -1297,6 +1297,10 @@
     }
 
     public void paint(final Graphics g, final JComponent c) {
+	if (g == null) {
+            throw new NullPointerException();
+        }
+
         if (tabPane.getTabCount() == 0) {
             return;
         }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUITest.java?view=diff&rev=517707&r1=517706&r2=517707
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUITest.java
Tue Mar 13 07:34:17 2007
@@ -34,6 +34,7 @@
 import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JTabbedPane;
+import javax.swing.JToolBar;
 import javax.swing.SwingConstants;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
@@ -543,7 +544,14 @@
     }
 
     public void testPaintGraphicsJComponent() {
-        // Note: painting code, cannot test
+        BasicTabbedPaneUI localBasicTabbedPaneUI = new BasicTabbedPaneUI(); 
+        localBasicTabbedPaneUI.installUI(new JTabbedPane());
+        try { 
+            localBasicTabbedPaneUI.paint(null, new JToolBar()); 
+            fail("NPE is not thrown"); 
+        } catch (NullPointerException e) {
+            // PASSED
+        } 
     }
 
     public void testPaintContentBorder() {



Mime
View raw message