harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496313 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicOptionPaneUI.java test/api/java/common/javax/swing/plaf/basic/BasicOptionPaneUITest.java
Date Mon, 15 Jan 2007 13:50:53 GMT
Author: hindessm
Date: Mon Jan 15 05:50:49 2007
New Revision: 496313

URL: http://svn.apache.org/viewvc?view=rev&rev=496313
Log:
Applying patches from "[#HARMONY-2902] [classlib][swing]
j.s.plaf.basic.BasicOptionPaneUI.getMaxCharactersPerLineCount doesn't throw
NPE".

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicOptionPaneUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicOptionPaneUI.java?view=diff&rev=496313&r1=496312&r2=496313
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicOptionPaneUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicOptionPaneUI.java
Mon Jan 15 05:50:49 2007
@@ -575,7 +575,7 @@
     }
 
     protected int getMaxCharactersPerLineCount() {
-        return Integer.MAX_VALUE;
+        return optionPane.getMaxCharactersPerLineCount();
     }
 
     protected void burstStringInto(final Container c, final String d,

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicOptionPaneUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicOptionPaneUITest.java?view=diff&rev=496313&r1=496312&r2=496313
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicOptionPaneUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicOptionPaneUITest.java
Mon Jan 15 05:50:49 2007
@@ -584,6 +584,35 @@
         assertEquals(Integer.MAX_VALUE, paneUI.getMaxCharactersPerLineCount());
     }
 
+    // Regression for HARMONY-2902
+    public void testGetMaxCharactersPerLineCount_OptionPane() {
+        final Marker marker = new Marker();
+        paneUI.optionPane = new JOptionPane() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public int getMaxCharactersPerLineCount() {
+                marker.setOccurred();
+                return super.getMaxCharactersPerLineCount();
+            }
+        };
+        paneUI.optionPane.setUI(paneUI);
+        marker.reset();
+        assertEquals(Integer.MAX_VALUE, paneUI.getMaxCharactersPerLineCount());
+        assertTrue(marker.isOccurred());
+    }
+
+    // Regression for HARMONY-2902
+    public void testGetMaxCharactersPerLineCount_Null() {
+        assertNull(paneUI.optionPane);
+        testExceptionalCase(new NullPointerCase() {
+            @Override
+            public void exceptionalAction() throws Exception {
+                paneUI.getMaxCharactersPerLineCount();
+            }
+        });
+    }
+
     public void testBurstStringInto() {
         String message = "message ";
         JPanel panel = new JPanel();



Mime
View raw message