harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Petrenko (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-1799) [classlib][swing] JTextPane throws NPE after we set null font.
Date Thu, 10 May 2007 11:49:16 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-1799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alexey Petrenko updated HARMONY-1799:
-------------------------------------

    Patch Info:   (was: [Patch Available])
      Assignee:     (was: Alexey Petrenko)

The Harmony with the patch does not pass the original test now.
Need additional investigation.

> [classlib][swing] JTextPane throws NPE after we set null font.
> --------------------------------------------------------------
>
>                 Key: HARMONY-1799
>                 URL: https://issues.apache.org/jira/browse/HARMONY-1799
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ilya Okomin
>            Priority: Minor
>         Attachments: Harmony-1799-test.patch, Harmony-1799.patch
>
>
> If we try to set JTextPane font to null Harmony throws NPE, while RI works silent.
> Test to reproduce:
> ---------------test.java-------------
> import javax.swing.JTextPane;
> import junit.framework.*;
> import junit.textui.TestRunner;
> public class test extends TestCase{
>     JTextPane textPane;
>     public static void main(String args[]) throws Exception{
>         TestRunner.run(test.class);
>     }
>     
>     public void testRun() throws Exception{
>         JTextPane textPane = new JTextPane();
>         textPane.setFont(null);
>     }
> }
> ------------------------------
> ====== Ouput RI =======
> .
> Time: 0.991
> OK (1 test)
> ====== Output Harmony ======
> .E
> Time: 0.531
> There was 1 error:
> 1) testRun(test)java.lang.NullPointerException
> 	at javax.swing.plaf.basic.BasicTextPaneUI.updateFontAttributes(BasicTextPaneUI.java:89)
> 	at javax.swing.plaf.basic.BasicTextPaneUI.propertyChange(BasicTextPaneUI.java:49)
> 	at javax.swing.plaf.basic.BasicTextUI$Listener.propertyChange(BasicTextUI.java:300)
> 	at java.beans.PropertyChangeSupport.doFirePropertyChange(PropertyChangeSupport.java:332)
> 	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:56)
> 	at java.awt.Component.firePropertyChangeImpl(Component.java:1666)
> 	at java.awt.Component.firePropertyChange(Component.java:1680)
> 	at java.awt.Component.setFont(Component.java:3104)
> 	at java.awt.Container.setFont(Container.java:1059)
> 	at test.testRun(test.java:14)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at test.main(test.java:10)
> FAILURES!!!
> Tests run: 1,  Failures: 0,  Errors: 1
> ======================================
> The reason of failure is uncompatible behavior with RI of the updating font style in
javax.swing.plaf.basic.BasicTextPaneUI.
> After innvestigation of this problem I found that in Harmony we do nothing if font is
null, or trying to access it's fields. And in RI if font is null its style attributes related
to Font just removed.
> I'll provide unit test and fix for this issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message