harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r515207 - 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/BasicTabbedPaneUI$TabbedPaneLayoutTest.java
Date Tue, 06 Mar 2007 16:49:28 GMT
Author: apetrenko
Date: Tue Mar  6 08:49:27 2007
New Revision: 515207

URL: http://svn.apache.org/viewvc?view=rev&rev=515207
Log:
Patch for HARMONY-2609 "[classlib][swing] Compatibility: javax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout.removeLayoutComponent()
throws NPE while RI does not"

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/BasicTabbedPaneUI$TabbedPaneLayoutTest.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=515207&r1=515206&r2=515207
==============================================================================
--- 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  6 08:49:27 2007
@@ -142,6 +142,9 @@
         }
 
         public void calculateLayoutInfo() {
+            if (tabPane == null) {
+                return;
+            }
             int tabCount = tabPane.getTabCount();
             final Component selectedComponent = tabPane.getSelectedComponent();
             if (selectedComponent != null) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayoutTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI%24TabbedPaneLayoutTest.java?view=diff&rev=515207&r1=515206&r2=515207
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayoutTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTabbedPaneUI$TabbedPaneLayoutTest.java
Tue Mar  6 08:49:27 2007
@@ -23,9 +23,12 @@
 import java.awt.Dimension;
 import javax.swing.ImageIcon;
 import javax.swing.JLabel;
+import javax.swing.JPopupMenu;
 import javax.swing.JTabbedPane;
 import javax.swing.SwingConstants;
 import javax.swing.SwingTestCase;
+import javax.swing.plaf.metal.MetalTabbedPaneUI;
+
 
 public class BasicTabbedPaneUI$TabbedPaneLayoutTest extends SwingTestCase {
     private JTabbedPane tabbed;
@@ -59,7 +62,15 @@
     }
 
     public void testCalculateLayoutInfo() {
-        // the documentation is empty, results are implementation specific
+        try {   
+            MetalTabbedPaneUI localMetalTabbedPaneUI = new MetalTabbedPaneUI();
+            BasicTabbedPaneUI.TabbedPaneLayout localTabbedPaneLayout =
+                localMetalTabbedPaneUI.new TabbedPaneLayout();
+            JPopupMenu localJPopupMenu = new JPopupMenu();
+            localTabbedPaneLayout.removeLayoutComponent(localJPopupMenu);
+        } catch (NullPointerException npe) {   
+            fail("NPE should not be thrown");            
+        }
     }
 
     public void testPreferredTabAreaHeight() {



Mime
View raw message