You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mikhail Loenko (JIRA)" <ji...@apache.org> on 2006/10/30 08:22:52 UTC
[jira] Closed: (HARMONY-1475) [classlib][swing/text] Editing text
in JTextComponent after updateUI() throws NPE
[ http://issues.apache.org/jira/browse/HARMONY-1475?page=all ]
Mikhail Loenko closed HARMONY-1475.
-----------------------------------
> [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
> Assigned To: Mikhail Loenko
> Attachments: 1475-BasicTextUI-tests.patch, H1475-BasicTextUI.patch, H1475-tests.patch
>
>
> 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