harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry A. Durnev (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1475) [classlib][swing/text] Editing text in JTextComponent after updateUI() throws NPE
Date Fri, 15 Sep 2006 11:54:22 GMT
[classlib][swing/text] Editing text in JTextComponent after updateUI() throws NPE
---------------------------------------------------------------------------------

                 Key: HARMONY-1475
                 URL: http://issues.apache.org/jira/browse/HARMONY-1475
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Dmitry A. Durnev


Compile & run the following code:

import javax.swing.JTextField;
import javax.swing.text.JTextComponent;

public class JTextFieldTest {
    public static void main(String[] args) {
        JTextComponent jtf = new JTextField();
        jtf.updateUI();
        jtf.setText("q");
        System.out.println(jtf.getText());
    }

}
On RI it prints text, on Harmony NPE is thrown:

java.lang.NullPointerException
	at java.awt.Toolkit$ComponentInternalsImpl.getTextFieldKit(Toolkit.java:260)
	at org.apache.harmony.awt.text.TextUtils.getTextFieldKit(TextUtils.java:432)
	at javax.swing.text.FieldView.adjustAllocation(FieldView.java:38)
	at javax.swing.text.FieldView.insertUpdate(FieldView.java:81)
	at javax.swing.text.RootView.insertUpdate(RootView.java:177)
	at javax.swing.plaf.basic.BasicTextUI$Listener.insertUpdate(BasicTextUI.java:255)
	at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:1210)
	at javax.swing.text.AbstractDocument.doInsert(AbstractDocument.java:1324)
	at javax.swing.text.PlainDocument.doInsert(PlainDocument.java:182)
	at javax.swing.text.AbstractDocument.doReplace(AbstractDocument.java:1375)
	at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:1160)
	at javax.swing.text.JTextComponent.setText(JTextComponent.java:1557)

The same NPE is thrown when editing text manually.
This issue can break some Swing apps.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message