harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Kishenko (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-2311) [classlib][awt] DefaultFocusTraversalPolicy.accept(Component aComponent) returns incorrect value
Date Fri, 24 Nov 2006 12:57:02 GMT
[classlib][awt] DefaultFocusTraversalPolicy.accept(Component aComponent) returns incorrect
value
------------------------------------------------------------------------------------------------

                 Key: HARMONY-2311
                 URL: http://issues.apache.org/jira/browse/HARMONY-2311
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Denis Kishenko


java.awt.DefaultFocusTraversalPolicy.accept(Component aComponent)() returns
incorrect value.

======== Spec =======
"Determines whether a Component is an acceptable choice as the new focus owner.
The Component must be visible, displayable, and enabled to be accepted"

========== Test ==========
import java.lang.reflect.*;
import javax.swing.*;
import java.awt.*;

public class Test {
         DefaultFocusTraversalPolicy _object;

    private Object invokeMethod(String name, Object[] args) throws Exception {
                _object = new DefaultFocusTraversalPolicy();


        Class[] tps = new Class[1];

        tps[0] = args[0].getClass();
                for(int i = 0; i < 4; i++) {
                        tps[0] = tps[0].getSuperclass();
                }

        Method mt = null;
        Class cls = DefaultFocusTraversalPolicy.class;

        mt = cls.getDeclaredMethod(name, tps);

        mt.setAccessible(true);
        return mt.invoke((Object)_object, args);
    }


    public static void main(String args[]) {
         Component c = new JButton();
     c.setVisible(true);
     c.setEnabled(true);     
     c.setFocusable(true);
     c.addNotify();
     try{ 
             System.out.println("accept(JButton) = " + new Test().invokeMethod("accept",new
Object[]{c}));
     } catch(Exception e){ 
                e.printStackTrace();
     } 
    }
}

=========== RI ============
accept(JButton) = true

========== Harmony =========
accept(JButton) = false


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