harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Artem Aliev (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2419) [swing] JTree.DynamicUtilTreeNode.clone() returns DefaultMutableTreeNode object
Date Mon, 04 Dec 2006 12:53:21 GMT
[swing] JTree.DynamicUtilTreeNode.clone() returns DefaultMutableTreeNode object
-------------------------------------------------------------------------------

                 Key: HARMONY-2419
                 URL: http://issues.apache.org/jira/browse/HARMONY-2419
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Artem Aliev


According to J2SE API 5.0 specifications of
DefaultMutableTreeNode.clone() method: "Returns a shallow copy of this node;
the new node has no parent or children and has a reference to the same user
object, if any."
javax.swing.JTree.DynamicUtilTreeNode.clone() returns
javax.swing.tree.DefaultMutableTreeNode object while RI returns
JTree.DynamicUtilTreeNode.

Test for reprodicing:
import junit.framework.TestCase;
import javax.swing.*;

public class Test extends TestCase {       
    public void testcase1() {
        Object obj = new Object();
        JTree.DynamicUtilTreeNode t = new JTree.DynamicUtilTreeNode(obj,obj);
        Object cl = t.clone();
        assertEquals(t.getClass(), cl.getClass());
    }
}

Output on Sun 1.5
=================
.
Time: 0.219

OK (1 test)

Output on Harmony:
==================
.F
Time: 1.234
There was 1 failure:
1) testcase1(Test)junit.framework.AssertionFailedError: expected:<class
javax.swing.JTree$DynamicUtilTreeNode> but was:<class java
x.swing.tree.DefaultMutableTreeNode>
        at Test.testcase1(Test.java:10)
        at java.lang.reflect.VMReflection.invokeMethod(Native Method)

FAILURES!!!
Tests run: 1,  Failures: 1,  Errors: 0


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

        

Mime
View raw message