harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496043 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java test/api/java/common/javax/swing/plaf/basic/BasicInternalFrameTitlePaneTest.java
Date Sun, 14 Jan 2007 09:15:54 GMT
Author: hindessm
Date: Sun Jan 14 01:15:53 2007
New Revision: 496043

URL: http://svn.apache.org/viewvc?view=rev&rev=496043
Log:
Applying patches from "[#HARMONY-2666] [classlib][swing]
javax.swing.plaf.metal.BasicInternalFrameTitlePane(null) doesn't throw
unspecified NPE while RI does".

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java?view=diff&rev=496043&r1=496042&r2=496043
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
Sun Jan 14 01:15:53 2007
@@ -419,13 +419,14 @@
     private TitlePaneInternals internals;
 
     public BasicInternalFrameTitlePane(final JInternalFrame frame) {
+        if (frame == null) {
+            throw new NullPointerException();  
+        } 
+
         this.frame = frame;
         setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0));
         installInternals();
-
-        if (frame != null) {
-            installTitlePane();
-        }
+        installTitlePane(); 
     }
 
     protected JMenuBar createSystemMenuBar() {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicInternalFrameTitlePaneTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicInternalFrameTitlePaneTest.java?view=diff&rev=496043&r1=496042&r2=496043
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicInternalFrameTitlePaneTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicInternalFrameTitlePaneTest.java
Sun Jan 14 01:15:53 2007
@@ -540,6 +540,15 @@
         // Note: painting code, cannot test
     }
 
+    
+    public void testConstructor() {
+        try {     
+            new BasicInternalFrameTitlePane((JInternalFrame) null); 
+            fail("NPE should be thrown");
+        } catch (NullPointerException npe) {    
+            // PASSED          
+        }
+    }
     public void testPaintComponent() {
         // Note: painting code, cannot test
     }



Mime
View raw message