harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Pavlenko (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2311) [classlib][awt] DefaultFocusTraversalPolicy.accept(Component aComponent) returns incorrect value
Date Fri, 02 Mar 2007 15:25:51 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-2311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477321
] 

Andrey Pavlenko commented on HARMONY-2311:
------------------------------------------

Alexey, the patch is applied as expected. You can close the issue. Thanks.

> [classlib][awt] DefaultFocusTraversalPolicy.accept(Component aComponent) returns incorrect
value
> ------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2311
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2311
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>         Assigned To: Alexey Petrenko
>         Attachments: ContainerOrderFocusTraversalPolicy.patch, DefaultFocusTraversalPolicyTest.patch
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message