harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Petrenko" <alexey.a.petre...@gmail.com>
Subject [classlib][swing] HARMONY-2895 - non-bug difference?
Date Fri, 02 Mar 2007 07:39:41 GMT
Guys,

here is an incompatibility described in HARMONY-2985:

=== cut ===
javax.swing.plaf.basic.BasicFileChooserUI.getApproveButtonMnemonic(null)
does not throw unspecified NPE
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).
=== cut ===

I would agree with Ilya and vote for closing this issue as non-bug
difference because FileChooserUI methods does not usualy use
FileChooser which is passed as method parameter. So it looks illogical
to throw an exception in few methods and do not throw in others.

Thoughts? Objections?

Mime
View raw message