harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r513470 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/JTextPane.java test/api/java/common/javax/swing/JTextPaneTest.java
Date Thu, 01 Mar 2007 20:01:35 GMT
Author: apetrenko
Date: Thu Mar  1 12:01:34 2007
New Revision: 513470

URL: http://svn.apache.org/viewvc?view=rev&rev=513470
Log:
Patch for HARMONY-2617 "[classlib][swing] javax.swing.JTextPane(null) does not throw unspecified
NPE"

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextPane.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextPaneTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextPane.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextPane.java?view=diff&rev=513470&r1=513469&r2=513470
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextPane.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextPane.java
Thu Mar  1 12:01:34 2007
@@ -55,6 +55,10 @@
 
     public JTextPane(final StyledDocument doc) {
         this();
+
+        if (doc == null) {
+            throw new NullPointerException();
+        } 
     }
 
     public String getUIClassID() {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextPaneTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextPaneTest.java?view=diff&rev=513470&r1=513469&r2=513470
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextPaneTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextPaneTest.java
Thu Mar  1 12:01:34 2007
@@ -607,4 +607,13 @@
         assertEquals(isSuperScript, StyleConstants.isSuperscript(attrs));
         assertEquals(isUnderline, StyleConstants.isUnderline(attrs));
     }
+
+    public void testConstructor() {
+        try {      
+            new JTextPane(null); 
+            fail("NPE should be thrown");
+        } catch (NullPointerException npe) {              
+            // PASSED            
+        }
+    }
 }



Mime
View raw message