harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r495954 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicTextAreaUI.java test/api/java/common/javax/swing/plaf/basic/BasicTextAreaUITest.java
Date Sat, 13 Jan 2007 19:43:10 GMT
Author: hindessm
Date: Sat Jan 13 11:43:10 2007
New Revision: 495954

URL: http://svn.apache.org/viewvc?view=rev&rev=495954
Log:
Applying patch from "[#HARMONY-2602] [classlib][swing][plaf]
javax.swing.plaf.basic.BasicTextAreaUI.create(null) doesn't throw NPE".

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTextAreaUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTextAreaUI.java?view=diff&rev=495954&r1=495953&r2=495954
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTextAreaUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTextAreaUI.java
Sat Jan 13 11:43:10 2007
@@ -56,8 +56,9 @@
 
     public View create(final Element element) {
         if (element == null) {
-            return null;
+            throw new NullPointerException();
         }
+
         Document doc = element.getDocument();
         Boolean i18n = (Boolean)doc.getProperty(StringConstants.BIDI_PROPERTY);
         if (i18n.booleanValue()) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTextAreaUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTextAreaUITest.java?view=diff&rev=495954&r1=495953&r2=495954
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTextAreaUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTextAreaUITest.java
Sat Jan 13 11:43:10 2007
@@ -96,6 +96,13 @@
         assertTrue(ui.create(elem) instanceof PlainView);
         jta.setLineWrap(true);
         assertTrue(ui.create(elem) instanceof WrappedPlainView);
+
+        try {      
+            new BasicTextAreaUI().create(null);  
+            fail("NPE should be thrown");
+        } catch (NullPointerException npe) {              
+            // PASSED            
+        } 
     }
 
     public void testGetPropertyPrefix() {



Mime
View raw message