harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r501436 - in /harmony/enhanced/classlib/trunk/modules/swing: make/exclude.common src/main/java/common/javax/swing/plaf/basic/BasicTextPaneUI.java src/test/api/java/common/javax/swing/plaf/basic/BasicTextUITest.java
Date Tue, 30 Jan 2007 16:10:34 GMT
Author: ayza
Date: Tue Jan 30 08:10:33 2007
New Revision: 501436

URL: http://svn.apache.org/viewvc?view=rev&rev=501436
Log:
Applying patch from HARMONY-2521 ([classlib][swing] j.s.text.JTextPane.updateUI() throws NPE).
BasicTextUITest was removed from the exclude list because I cannot reproduce any failures.


Modified:
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.common
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTextPaneUI.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTextUITest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.common
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.common?view=diff&rev=501436&r1=501435&r2=501436
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.common (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.common Tue Jan 30 08:10:33
2007
@@ -71,7 +71,6 @@
 javax/swing/plaf/basic/BasicTextAreaUITest.java
 javax/swing/plaf/basic/BasicTextFieldUITest.java
 javax/swing/plaf/basic/BasicTextPaneUITest.java
-javax/swing/plaf/basic/BasicTextUITest.java
 javax/swing/plaf/basic/BasicToolBarUI$DragWindowTest.java
 javax/swing/plaf/basic/BasicToolBarUITest.java
 javax/swing/plaf/basic/BasicTreeUITest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTextPaneUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTextPaneUI.java?view=diff&rev=501436&r1=501435&r2=501436
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTextPaneUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicTextPaneUI.java
Tue Jan 30 08:10:33 2007
@@ -46,8 +46,12 @@
 
         final String propName = e.getPropertyName();
 
+        if (e.getNewValue() == null) {
+            return;
+        }
+
         if (StringConstants.FONT_PROPERTY_CHANGED.equals(propName)) {
-            updateFontAttributes(getDefaultStyle(e), (Font)e.getNewValue());
+            updateFontAttributes(getDefaultStyle(e), (Font) e.getNewValue());
         } else if (StringConstants.FOREGROUND_PROPERTY_CHANGED.equals(propName)) {
             getDefaultStyle(e).addAttribute(StyleConstants.Foreground,
                                             e.getNewValue());
@@ -55,8 +59,9 @@
             setDefaultStyle(e);
         }
     }
+
     private Style getDefaultStyle(final EventObject e) {
-        return ((JTextPane)e.getSource()).getStyledDocument()
+        return ((JTextPane) e.getSource()).getStyledDocument()
                .getStyle(StyleContext.DEFAULT_STYLE);
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTextUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTextUITest.java?view=diff&rev=501436&r1=501435&r2=501436
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTextUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTextUITest.java
Tue Jan 30 08:10:33 2007
@@ -436,6 +436,9 @@
         tmp = findAndRemoveSubstring(tmp, "uninstallKeyboardActions::");
         tmp = findAndRemoveSubstring(tmp, "uninstallListeners::");
         assertEquals("", tmp);
+
+        // regression for HARMONY-2521          
+        new javax.swing.JTextPane().updateUI();            
     }
 
     public void testInstallUI() throws Exception {



Mime
View raw message