You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Sergey Krivenko (JIRA)" <ji...@apache.org> on 2007/02/19 10:55:05 UTC

[jira] Updated: (HARMONY-2895) [classlib][swing] Compatibility: javax.swing.plaf.basic.BasicFileChooserUI.getApproveButtonMnemonic(null) does not throw unspecified NPE

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

Sergey Krivenko updated HARMONY-2895:
-------------------------------------

    Attachment: Harmony-2895-BasicFileChooserUI.patch

Simply throwing NPE if JFileChooser is null for compatibility  

> [classlib][swing] Compatibility: javax.swing.plaf.basic.BasicFileChooserUI.getApproveButtonMnemonic(null) does not throw unspecified NPE
> ----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2895
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2895
>             Project: Harmony
>          Issue Type: Bug
>          Components: Non-bug differences from RI
>            Reporter: Ilya Okomin
>            Priority: Minor
>         Attachments: Harmony-2895-BasicFileChooserUI.patch
>
>
> There is no mention of any exception in the specification. But RI throws unspecified NPE for getApproveButtonMnemonic(null) while Harmony does not.
> Test case to reproduce, that passes on RI and fails on Harmony:
> ----------- test.java ----------------
> import javax.swing.JFileChooser;
> import javax.swing.plaf.basic.BasicFileChooserUI;
> import junit.framework.TestCase;
> import junit.textui.TestRunner;
> public class test extends TestCase {
>     public static void main(String args[]) {
>         TestRunner.run(test.class);
>     }
>     public void testRun() {
>         try {
>             BasicFileChooserUI cb = new BasicFileChooserUI(new JFileChooser());
>             cb.getApproveButtonMnemonic(null);
>             fail("NullPointerException expected");
>         } catch (NullPointerException e) {
>             // expected
>         }
>     }
> }
> ----------------------------------------
> I suppose this case can be treated as non-bug difference.
> Note: The same case with getApproveButtonToolTipText(null) and cb.getApproveButtonText((JFileChooser) null).

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