[classlib][swing] DefaultTreeSelectionModel.getSelectionRows() returns empty array while RI
returns null
--------------------------------------------------------------------------------------------------------
Key: HARMONY-2770
URL: http://issues.apache.org/jira/browse/HARMONY-2770
Project: Harmony
Issue Type: Bug
Components: Classlib
Reporter: Denis Kishenko
According to the specification method returns "all of the currently selected rows. This will
return null (or an empty array) if there are no selected TreePaths or a RowMapper has not
been set".
Harmony returns empty array while RI returns null.
It is compatibility issue.
import junit.framework.TestCase;
import javax.swing.tree.*;
public class test extends TestCase {
public void testcase1() {
DefaultTreeSelectionModel t=new DefaultTreeSelectionModel();
int [] a=t.getSelectionRows();
assertEquals(0, a.length);
}
}
Output on RI:
.E
Time: 0
There was 1 error:
1) testcase1(test)java.lang.NullPointerException
at test.testcase1(test.java:9)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
FAILURES!!!
Tests run: 1, Failures: 0, Errors: 1
OK (1 test)
Output on Harmony:
.
Time: 0.016
OK (1 test)
--
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
|