harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r489611 - in /harmony/enhanced/classlib/trunk/modules/swing: make/ src/main/java/common/javax/swing/plaf/basic/ src/test/api/java/common/javax/swing/plaf/basic/
Date Fri, 22 Dec 2006 10:53:56 GMT
Author: smishura
Date: Fri Dec 22 02:53:55 2006
New Revision: 489611

URL: http://svn.apache.org/viewvc?view=rev&rev=489611
Log:
Roll back commit r489362
Patch for HARMONY-1799 "[classlib][swing] JTextPane throws NPE after we set null font."

The test BasicTextPaneUITest.java may crash VM. Will reopen the bug report

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm
    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/BasicTextPaneUITest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl?view=diff&rev=489611&r1=489610&r2=489611
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl Fri Dec 22 02:53:55
2006
@@ -89,6 +89,7 @@
 javax/swing/plaf/basic/BasicTableUITest.java
 javax/swing/plaf/basic/BasicTextAreaUITest.java
 javax/swing/plaf/basic/BasicTextFieldUITest.java
+javax/swing/plaf/basic/BasicTextPaneUITest.java
 javax/swing/plaf/basic/BasicToolBarUI$DragWindowTest.java
 javax/swing/plaf/basic/BasicToolBarUITest.java
 javax/swing/plaf/metal/MetalComboBoxIconTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm?view=diff&rev=489611&r1=489610&r2=489611
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm Fri Dec 22 02:53:55
2006
@@ -89,6 +89,7 @@
 javax/swing/plaf/basic/BasicTableUITest.java
 javax/swing/plaf/basic/BasicTextAreaUITest.java
 javax/swing/plaf/basic/BasicTextFieldUITest.java
+javax/swing/plaf/basic/BasicTextPaneUITest.java
 javax/swing/plaf/basic/BasicToolBarUI$DragWindowTest.java
 javax/swing/plaf/basic/BasicToolBarUITest.java
 javax/swing/plaf/metal/MetalComboBoxIconTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl?view=diff&rev=489611&r1=489610&r2=489611
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl Fri Dec 22
02:53:55 2006
@@ -92,6 +92,7 @@
 javax/swing/plaf/basic/BasicTableUITest.java
 javax/swing/plaf/basic/BasicTextAreaUITest.java
 javax/swing/plaf/basic/BasicTextFieldUITest.java
+javax/swing/plaf/basic/BasicTextPaneUITest.java
 javax/swing/plaf/basic/BasicToolBarUI$DragWindowTest.java
 javax/swing/plaf/basic/BasicToolBarUITest.java
 javax/swing/plaf/metal/MetalComboBoxIconTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm?view=diff&rev=489611&r1=489610&r2=489611
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm Fri Dec 22
02:53:55 2006
@@ -89,6 +89,7 @@
 javax/swing/plaf/basic/BasicTableUITest.java
 javax/swing/plaf/basic/BasicTextAreaUITest.java
 javax/swing/plaf/basic/BasicTextFieldUITest.java
+javax/swing/plaf/basic/BasicTextPaneUITest.java
 javax/swing/plaf/basic/BasicToolBarUI$DragWindowTest.java
 javax/swing/plaf/basic/BasicToolBarUITest.java
 javax/swing/plaf/metal/MetalComboBoxIconTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl?view=diff&rev=489611&r1=489610&r2=489611
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl Fri Dec 22
02:53:55 2006
@@ -93,6 +93,7 @@
 javax/swing/plaf/basic/BasicTableUITest.java
 javax/swing/plaf/basic/BasicTextAreaUITest.java
 javax/swing/plaf/basic/BasicTextFieldUITest.java
+javax/swing/plaf/basic/BasicTextPaneUITest.java
 javax/swing/plaf/basic/BasicToolBarUI$DragWindowTest.java
 javax/swing/plaf/basic/BasicToolBarUITest.java
 javax/swing/plaf/metal/MetalComboBoxIconTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm?view=diff&rev=489611&r1=489610&r2=489611
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm Fri Dec 22
02:53:55 2006
@@ -100,6 +100,7 @@
 javax/swing/plaf/basic/BasicTableUITest.java
 javax/swing/plaf/basic/BasicTextAreaUITest.java
 javax/swing/plaf/basic/BasicTextFieldUITest.java
+javax/swing/plaf/basic/BasicTextPaneUITest.java
 javax/swing/plaf/basic/BasicToolBarUI$DragWindowTest.java
 javax/swing/plaf/basic/BasicToolBarUITest.java
 javax/swing/plaf/metal/MetalComboBoxIconTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl?view=diff&rev=489611&r1=489610&r2=489611
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl Fri Dec
22 02:53:55 2006
@@ -89,6 +89,7 @@
 javax/swing/plaf/basic/BasicTableUITest.java
 javax/swing/plaf/basic/BasicTextAreaUITest.java
 javax/swing/plaf/basic/BasicTextFieldUITest.java
+javax/swing/plaf/basic/BasicTextPaneUITest.java
 javax/swing/plaf/basic/BasicToolBarUI$DragWindowTest.java
 javax/swing/plaf/basic/BasicToolBarUITest.java
 javax/swing/plaf/metal/MetalComboBoxIconTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm?view=diff&rev=489611&r1=489610&r2=489611
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm Fri Dec
22 02:53:55 2006
@@ -89,6 +89,7 @@
 javax/swing/plaf/basic/BasicTableUITest.java
 javax/swing/plaf/basic/BasicTextAreaUITest.java
 javax/swing/plaf/basic/BasicTextFieldUITest.java
+javax/swing/plaf/basic/BasicTextPaneUITest.java
 javax/swing/plaf/basic/BasicToolBarUI$DragWindowTest.java
 javax/swing/plaf/basic/BasicToolBarUITest.java
 javax/swing/plaf/metal/MetalComboBoxIconTest.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=489611&r1=489610&r2=489611
==============================================================================
--- 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
Fri Dec 22 02:53:55 2006
@@ -67,6 +67,9 @@
         }
 
         final Font f = pane.getFont();
+        if (f == null) {
+            return;
+        }
 
         final Style style = getDefaultStyle(e);
 
@@ -80,16 +83,9 @@
 
 
     private void updateFontAttributes(final Style style, final Font f) {
-        if (f == null){
-            style.removeAttribute(StyleConstants.Italic);
-            style.removeAttribute(StyleConstants.Bold);
-            style.removeAttribute(StyleConstants.FontFamily);
-            style.removeAttribute(StyleConstants.FontSize);
-        } else {
-            style.addAttribute(StyleConstants.Italic, Boolean.valueOf(f.isItalic()));
-            style.addAttribute(StyleConstants.Bold, Boolean.valueOf(f.isBold()));
-            style.addAttribute(StyleConstants.FontFamily, f.getName());
-            style.addAttribute(StyleConstants.FontSize, new Integer(f.getSize()));
-        }
+        style.addAttribute(StyleConstants.Italic, Boolean.valueOf(f.isItalic()));
+        style.addAttribute(StyleConstants.Bold, Boolean.valueOf(f.isBold()));
+        style.addAttribute(StyleConstants.FontFamily, f.getName());
+        style.addAttribute(StyleConstants.FontSize, new Integer(f.getSize()));
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTextPaneUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTextPaneUITest.java?view=diff&rev=489611&r1=489610&r2=489611
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTextPaneUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicTextPaneUITest.java
Fri Dec 22 02:53:55 2006
@@ -141,37 +141,4 @@
         assertFalse(font.getFamily().equals(newStyle.getAttribute(StyleConstants.FontFamily)));
         assertEquals(font.getName(), newStyle.getAttribute(StyleConstants.FontFamily));
     }
-    public void testPropertyChange_NullFont() {
-        // regression test to HARMONY-1799
-        
-        textPane = new JTextPane();
-
-        textPane.setFont(font);
-        Style style = textPane.getStyle(StyleContext.DEFAULT_STYLE);
-        style.addAttribute(StyleConstants.Italic, Boolean.TRUE);
-        style.addAttribute(StyleConstants.Bold, Boolean.TRUE);
-        textPane.setFont(null);
-        assertNull(style.getAttribute(StyleConstants.FontFamily));
-        assertNull(style.getAttribute(StyleConstants.Italic));
-        assertNull(style.getAttribute(StyleConstants.Bold));
-
-        StyledDocument newDoc = new DefaultStyledDocument();
-        Style newStyle = newDoc.getStyle(StyleContext.DEFAULT_STYLE);
-        assertEquals(1, newStyle.getAttributeCount());
-        newStyle.addAttribute(StyleConstants.Italic, Boolean.FALSE);
-        newStyle.addAttribute(StyleConstants.Bold, Boolean.TRUE);
-        newStyle.addAttribute(StyleConstants.StrikeThrough, Boolean.FALSE);
-        textPane.setForeground(Color.RED);
-        textPane.setDocument(newDoc);
-        assertSame(textPane.getStyle(StyleContext.DEFAULT_STYLE), newStyle);
-        assertNull(textPane.getFont());
-        assertNull(newStyle.getAttribute(StyleConstants.FontFamily));
-        assertNull(newStyle.getAttribute(StyleConstants.Italic));
-        assertNull(newStyle.getAttribute(StyleConstants.Bold));
-        assertSame(newStyle.getAttribute(StyleConstants.Foreground),
-                   textPane.getForeground());
-        assertFalse(((Boolean)newStyle.getAttribute(StyleConstants.StrikeThrough))
-                     .booleanValue());
-    }
-
 }



Mime
View raw message