You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrey Pavlenko (JIRA)" <ji...@apache.org> on 2007/01/31 10:20:05 UTC
[jira] Updated: (HARMONY-2311) [classlib][awt]
DefaultFocusTraversalPolicy.accept(Component aComponent) returns incorrect
value
[ https://issues.apache.org/jira/browse/HARMONY-2311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrey Pavlenko updated HARMONY-2311:
-------------------------------------
Attachment: DefaultFocusTraversalPolicyTest.patch
ContainerOrderFocusTraversalPolicy.patch
The patches are attached.
> [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
> 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.