harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496247 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicFileChooserUI.java test/api/java/common/javax/swing/plaf/basic/BasicFileChooserUITest.java
Date Mon, 15 Jan 2007 08:37:48 GMT
Author: hindessm
Date: Mon Jan 15 00:37:47 2007
New Revision: 496247

URL: http://svn.apache.org/viewvc?view=rev&rev=496247
Log:
Applying patches from "[#HARMONY-2823] [classlib][swing]
javax.swing.plaf.basic.BasicFileChooserUI.getApproveButtonToolTipText(null)
returns null while RI throws NPE".

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicFileChooserUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicFileChooserUI.java?view=diff&rev=496247&r1=496246&r2=496247
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicFileChooserUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicFileChooserUI.java
Mon Jan 15 00:37:47 2007
@@ -672,6 +672,10 @@
     }
 
     public String getApproveButtonToolTipText(final JFileChooser fc) {
+	if (fc == null) {
+            throw new NullPointerException();
+        }
+
         return approveButtonToolTipText;
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicFileChooserUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicFileChooserUITest.java?view=diff&rev=496247&r1=496246&r2=496247
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicFileChooserUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicFileChooserUITest.java
Mon Jan 15 00:37:47 2007
@@ -75,6 +75,17 @@
         assertEquals(0, ui.getApproveButtonMnemonic(fc));
     }
 
+    public void testGetApproveButtonToolTipText() throws Exception {
+        try {     
+            javax.swing.plaf.basic.BasicFileChooserUI b = 
+                new javax.swing.plaf.basic.BasicFileChooserUI(new JFileChooser("")); 
+            b.getApproveButtonToolTipText(null); 
+            fail("NPE should be thrown");
+        } catch (NullPointerException npe) {    
+            // PASSED          
+        }
+    }
+
     public void testGetModel() throws Exception {
         ui.installUI(fc);
         assertNotNull(ui.getModel());



Mime
View raw message