Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-2895

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • None
    • Patch Available

    Description

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

      Attachments

        1. Harmony-2895-BasicFileChooserUITest.patch
          0.7 kB
          Sergey Krivenko
        2. Harmony-2895-BasicFileChooserUI.patch
          0.5 kB
          Sergey Krivenko

        Activity

          People

            cap Alexey Petrenko
            ilya.okomin Ilya Okomin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: