harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey A. Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2523) [classlib][swing] j.s.text.JFormattedTextField(Object) throws NPE when Object.toString() == null
Date Thu, 07 Dec 2006 14:37:26 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-2523?page=comments#action_12456434 ] 
            
Alexey A. Ivanov commented on HARMONY-2523:
-------------------------------------------

The following code throws NPE on Harmony:

===============================
import javax.swing.JFormattedTextField;

public class HTest2523 {
    public static void main(String[] args) {
        final Object obj= new Object() {
            @Override
            public String toString() {
                return null;
            }
        };
        final JFormattedTextField ftf = new JFormattedTextField(obj);
        System.out.println("'" + ftf.getText() + "'");
    }
}
===============================


The expected output is:
''

That is getText() returns empty string.

> [classlib][swing] j.s.text.JFormattedTextField(Object) throws NPE when Object.toString()
== null
> ------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2523
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2523
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Alexey A. Ivanov
>            Priority: Minor
>


-- 
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