harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Hindess (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-2822) [classlib][swing] javax.swing.plaf.basic.BasicFileChooserUI.installDefaults(null) returns null while RI throws NPE
Date Thu, 18 Jan 2007 10:16:30 GMT

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

Mark Hindess closed HARMONY-2822.
---------------------------------


Verified.


> [classlib][swing] javax.swing.plaf.basic.BasicFileChooserUI.installDefaults(null) returns
null while RI throws NPE
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2822
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2822
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Oleg Khaschansky
>         Assigned To: Mark Hindess
>            Priority: Minor
>         Attachments: Harmony-2822-BasicFileChooserUI.patch, Harmony-2822-BasicFileChooserUITest.patch
>
>
> javax.swing.plaf.basic.BasicFileChooserUI.installDefaults(null) returns null on Harmony
while RI throws NPE.
> Current implementation of BasicFileChooserUI.installDefaults(JFileChooser fc) simply
ignores the parameter, so it doesn't throw this unspecified NPE. I suggest to treat this as
a non-bug difference.
> The following testcase demonstrates this behavior:
> --------------------------------------------------------------------------------------
> import junit.framework.TestCase;
> import javax.swing.plaf.basic.BasicFileChooserUI;
> import javax.swing.*;
> import java.lang.reflect.InvocationTargetException;
> public class Test0 extends TestCase {
>     public void testcase1() {
>         BasicFileChooserUI jm = new BasicFileChooserUI(null);
>         java.lang.reflect.Method mt = null;
>         Class cls = BasicFileChooserUI.class;
>         try{
>             mt = cls.getDeclaredMethod( "installDefaults", JFileChooser.class);
>         } catch(Exception e) {
>             e.printStackTrace();
>         }
>         mt.setAccessible(true);
>         Object[] obj ={null};
>         try {
>             mt.invoke(jm, obj );
>             fail("NPE should be thrown");
>         } catch ( IllegalAccessException ae) {
>             ae.printStackTrace();
>         } catch ( InvocationTargetException ie) {
>         }
>     }
> }

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

        

Mime
View raw message