You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Pavel Dolgov (JIRA)" <ji...@apache.org> on 2006/12/06 14:20:22 UTC

[jira] Created: (HARMONY-2493) [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object

[classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object
-------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-2493
                 URL: http://issues.apache.org/jira/browse/HARMONY-2493
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Pavel Dolgov
            Priority: Minor


Test case:
--------------
import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.Container;
import java.awt.event.KeyEvent;
import java.util.Set;

import junit.framework.TestCase;

public class TheTest extends TestCase {

    public static void main(String args[]) {
        junit.textui.TestRunner.run(TheTest.class);
    }

    public void testcase1() {
        KeyboardFocusManagerImpl obj = new KeyboardFocusManagerImpl();
        Set keys = obj.getDefaultFocusTraversalKeys(1);
        assertNotNull(keys);
        assertTrue(keys.size() > 0);
    }

    class KeyboardFocusManagerImpl extends java.awt.KeyboardFocusManager {
        public KeyboardFocusManagerImpl() {
            super();
        }

        public boolean dispatchEvent(AWTEvent arg0) {
            return false;
        }

        public boolean dispatchKeyEvent(KeyEvent arg0) {
            return false;
        }

        public boolean postProcessKeyEvent(KeyEvent arg0) {
            return false;
        }

        public void processKeyEvent(Component arg0, KeyEvent arg1) {
        }

        protected void enqueueKeyEvents(long arg0, Component arg1) {
        }

        protected void dequeueKeyEvents(long arg0, Component arg1) {
        }

        protected void discardKeyEvents(Component arg0) {
        }

        public void focusNextComponent(Component arg0) {
        }

        public void focusPreviousComponent(Component arg0) {
        }

        public void upFocusCycle(Component arg0) {
        }

        public void downFocusCycle(Container arg0) {
        }
    }
}

RI output:
-------------
.
Time: 0,991

OK (1 test)

Harmony output:
--------------
.F
Time: 0.361
There was 1 failure:
1) testcase1(TheTest)junit.framework.AssertionFailedError
	at TheTest.testcase1(TheTest.java:17)
	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
	at TheTest.main(TheTest.java:12)

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

        

[jira] Updated: (HARMONY-2493) [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov updated HARMONY-2493:
-------------------------------------

    Patch Info: [Patch Available]

> [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2493
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2493
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: BasicTextUI.patch, DefaultKeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManagerRTest.patch, KeyboardFocusManagerTest.patch, PerfTest.java
>
>
> Test case:
> --------------
> import java.awt.AWTEvent;
> import java.awt.Component;
> import java.awt.Container;
> import java.awt.event.KeyEvent;
> import java.util.Set;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         KeyboardFocusManagerImpl obj = new KeyboardFocusManagerImpl();
>         Set keys = obj.getDefaultFocusTraversalKeys(1);
>         assertNotNull(keys);
>         assertTrue(keys.size() > 0);
>     }
>     class KeyboardFocusManagerImpl extends java.awt.KeyboardFocusManager {
>         public KeyboardFocusManagerImpl() {
>             super();
>         }
>         public boolean dispatchEvent(AWTEvent arg0) {
>             return false;
>         }
>         public boolean dispatchKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public boolean postProcessKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public void processKeyEvent(Component arg0, KeyEvent arg1) {
>         }
>         protected void enqueueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void dequeueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void discardKeyEvents(Component arg0) {
>         }
>         public void focusNextComponent(Component arg0) {
>         }
>         public void focusPreviousComponent(Component arg0) {
>         }
>         public void upFocusCycle(Component arg0) {
>         }
>         public void downFocusCycle(Container arg0) {
>         }
>     }
> }
> RI output:
> -------------
> .
> Time: 0,991
> OK (1 test)
> Harmony output:
> --------------
> .F
> Time: 0.361
> There was 1 failure:
> 1) testcase1(TheTest)junit.framework.AssertionFailedError
> 	at TheTest.testcase1(TheTest.java:17)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:12)
> 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: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2493) [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object

Posted by "Andrey Pavlenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2493?page=all ]

Andrey Pavlenko updated HARMONY-2493:
-------------------------------------

    Attachment: KeyboardFocusManagerRTest.patch

The regression test is attached.

> [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2493
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2493
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: DefaultKeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManagerRTest.patch, KeyboardFocusManagerTest.patch, PerfTest.java
>
>
> Test case:
> --------------
> import java.awt.AWTEvent;
> import java.awt.Component;
> import java.awt.Container;
> import java.awt.event.KeyEvent;
> import java.util.Set;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         KeyboardFocusManagerImpl obj = new KeyboardFocusManagerImpl();
>         Set keys = obj.getDefaultFocusTraversalKeys(1);
>         assertNotNull(keys);
>         assertTrue(keys.size() > 0);
>     }
>     class KeyboardFocusManagerImpl extends java.awt.KeyboardFocusManager {
>         public KeyboardFocusManagerImpl() {
>             super();
>         }
>         public boolean dispatchEvent(AWTEvent arg0) {
>             return false;
>         }
>         public boolean dispatchKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public boolean postProcessKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public void processKeyEvent(Component arg0, KeyEvent arg1) {
>         }
>         protected void enqueueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void dequeueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void discardKeyEvents(Component arg0) {
>         }
>         public void focusNextComponent(Component arg0) {
>         }
>         public void focusPreviousComponent(Component arg0) {
>         }
>         public void upFocusCycle(Component arg0) {
>         }
>         public void downFocusCycle(Container arg0) {
>         }
>     }
> }
> RI output:
> -------------
> .
> Time: 0,991
> OK (1 test)
> Harmony output:
> --------------
> .F
> Time: 0.361
> There was 1 failure:
> 1) testcase1(TheTest)junit.framework.AssertionFailedError
> 	at TheTest.testcase1(TheTest.java:17)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:12)
> 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

        

[jira] Assigned: (HARMONY-2493) [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2493?page=all ]

Alexei Zakharov reassigned HARMONY-2493:
----------------------------------------

    Assignee: Alexei Zakharov

> [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2493
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2493
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: DefaultKeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManagerTest.patch, PerfTest.java
>
>
> Test case:
> --------------
> import java.awt.AWTEvent;
> import java.awt.Component;
> import java.awt.Container;
> import java.awt.event.KeyEvent;
> import java.util.Set;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         KeyboardFocusManagerImpl obj = new KeyboardFocusManagerImpl();
>         Set keys = obj.getDefaultFocusTraversalKeys(1);
>         assertNotNull(keys);
>         assertTrue(keys.size() > 0);
>     }
>     class KeyboardFocusManagerImpl extends java.awt.KeyboardFocusManager {
>         public KeyboardFocusManagerImpl() {
>             super();
>         }
>         public boolean dispatchEvent(AWTEvent arg0) {
>             return false;
>         }
>         public boolean dispatchKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public boolean postProcessKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public void processKeyEvent(Component arg0, KeyEvent arg1) {
>         }
>         protected void enqueueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void dequeueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void discardKeyEvents(Component arg0) {
>         }
>         public void focusNextComponent(Component arg0) {
>         }
>         public void focusPreviousComponent(Component arg0) {
>         }
>         public void upFocusCycle(Component arg0) {
>         }
>         public void downFocusCycle(Container arg0) {
>         }
>     }
> }
> RI output:
> -------------
> .
> Time: 0,991
> OK (1 test)
> Harmony output:
> --------------
> .F
> Time: 0.361
> There was 1 failure:
> 1) testcase1(TheTest)junit.framework.AssertionFailedError
> 	at TheTest.testcase1(TheTest.java:17)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:12)
> 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

        

[jira] Updated: (HARMONY-2493) [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object

Posted by "Andrey Pavlenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2493?page=all ]

Andrey Pavlenko updated HARMONY-2493:
-------------------------------------

    Attachment: KeyboardFocusManager.patch
                BasicTextUI.patch

Alexey, the issue is in the javax.swing.plaf.basic.BasicTextUI class - there are attempts to modify unmodifiable map, returned by the Component.getFocusTraversalKeys() method. I've attached the patch fixing this issue.
Also I've attached new patch for the KeyboardFocusManager class. This patch does not contain code style formatting, thus it's more readable.

> [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2493
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2493
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: BasicTextUI.patch, DefaultKeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManagerRTest.patch, KeyboardFocusManagerTest.patch, PerfTest.java
>
>
> Test case:
> --------------
> import java.awt.AWTEvent;
> import java.awt.Component;
> import java.awt.Container;
> import java.awt.event.KeyEvent;
> import java.util.Set;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         KeyboardFocusManagerImpl obj = new KeyboardFocusManagerImpl();
>         Set keys = obj.getDefaultFocusTraversalKeys(1);
>         assertNotNull(keys);
>         assertTrue(keys.size() > 0);
>     }
>     class KeyboardFocusManagerImpl extends java.awt.KeyboardFocusManager {
>         public KeyboardFocusManagerImpl() {
>             super();
>         }
>         public boolean dispatchEvent(AWTEvent arg0) {
>             return false;
>         }
>         public boolean dispatchKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public boolean postProcessKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public void processKeyEvent(Component arg0, KeyEvent arg1) {
>         }
>         protected void enqueueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void dequeueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void discardKeyEvents(Component arg0) {
>         }
>         public void focusNextComponent(Component arg0) {
>         }
>         public void focusPreviousComponent(Component arg0) {
>         }
>         public void upFocusCycle(Component arg0) {
>         }
>         public void downFocusCycle(Container arg0) {
>         }
>     }
> }
> RI output:
> -------------
> .
> Time: 0,991
> OK (1 test)
> Harmony output:
> --------------
> .F
> Time: 0.361
> There was 1 failure:
> 1) testcase1(TheTest)junit.framework.AssertionFailedError
> 	at TheTest.testcase1(TheTest.java:17)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:12)
> 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

        

[jira] Commented: (HARMONY-2493) [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2493?page=comments#action_12460263 ] 
            
Alexei Zakharov commented on HARMONY-2493:
------------------------------------------

Andrey, you patches introduce 16  new failures and 175 errors in the SWING module :) Can you please comment?

> [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2493
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2493
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: DefaultKeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManagerRTest.patch, KeyboardFocusManagerTest.patch, PerfTest.java
>
>
> Test case:
> --------------
> import java.awt.AWTEvent;
> import java.awt.Component;
> import java.awt.Container;
> import java.awt.event.KeyEvent;
> import java.util.Set;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         KeyboardFocusManagerImpl obj = new KeyboardFocusManagerImpl();
>         Set keys = obj.getDefaultFocusTraversalKeys(1);
>         assertNotNull(keys);
>         assertTrue(keys.size() > 0);
>     }
>     class KeyboardFocusManagerImpl extends java.awt.KeyboardFocusManager {
>         public KeyboardFocusManagerImpl() {
>             super();
>         }
>         public boolean dispatchEvent(AWTEvent arg0) {
>             return false;
>         }
>         public boolean dispatchKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public boolean postProcessKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public void processKeyEvent(Component arg0, KeyEvent arg1) {
>         }
>         protected void enqueueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void dequeueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void discardKeyEvents(Component arg0) {
>         }
>         public void focusNextComponent(Component arg0) {
>         }
>         public void focusPreviousComponent(Component arg0) {
>         }
>         public void upFocusCycle(Component arg0) {
>         }
>         public void downFocusCycle(Container arg0) {
>         }
>     }
> }
> RI output:
> -------------
> .
> Time: 0,991
> OK (1 test)
> Harmony output:
> --------------
> .F
> Time: 0.361
> There was 1 failure:
> 1) testcase1(TheTest)junit.framework.AssertionFailedError
> 	at TheTest.testcase1(TheTest.java:17)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:12)
> 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

        

[jira] Commented: (HARMONY-2493) [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2493?page=comments#action_12460604 ] 
            
Alexei Zakharov commented on HARMONY-2493:
------------------------------------------

Andrey & Pavel, thanks for your work. I applied the following patches : KeyboardFocusManager.patch (version 2), BasicTextUI.patch, DefaultKeyboardFocusManager.patch + patches for tests at the revision r489795. Please verify. BTW I have also removed both tests from exclude lists.  

> [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2493
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2493
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: BasicTextUI.patch, DefaultKeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManagerRTest.patch, KeyboardFocusManagerTest.patch, PerfTest.java
>
>
> Test case:
> --------------
> import java.awt.AWTEvent;
> import java.awt.Component;
> import java.awt.Container;
> import java.awt.event.KeyEvent;
> import java.util.Set;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         KeyboardFocusManagerImpl obj = new KeyboardFocusManagerImpl();
>         Set keys = obj.getDefaultFocusTraversalKeys(1);
>         assertNotNull(keys);
>         assertTrue(keys.size() > 0);
>     }
>     class KeyboardFocusManagerImpl extends java.awt.KeyboardFocusManager {
>         public KeyboardFocusManagerImpl() {
>             super();
>         }
>         public boolean dispatchEvent(AWTEvent arg0) {
>             return false;
>         }
>         public boolean dispatchKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public boolean postProcessKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public void processKeyEvent(Component arg0, KeyEvent arg1) {
>         }
>         protected void enqueueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void dequeueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void discardKeyEvents(Component arg0) {
>         }
>         public void focusNextComponent(Component arg0) {
>         }
>         public void focusPreviousComponent(Component arg0) {
>         }
>         public void upFocusCycle(Component arg0) {
>         }
>         public void downFocusCycle(Container arg0) {
>         }
>     }
> }
> RI output:
> -------------
> .
> Time: 0,991
> OK (1 test)
> Harmony output:
> --------------
> .F
> Time: 0.361
> There was 1 failure:
> 1) testcase1(TheTest)junit.framework.AssertionFailedError
> 	at TheTest.testcase1(TheTest.java:17)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:12)
> 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

        

[jira] Updated: (HARMONY-2493) [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object

Posted by "Andrey Pavlenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2493?page=all ]

Andrey Pavlenko updated HARMONY-2493:
-------------------------------------

    Attachment: KeyboardFocusManager.patch
                KeyboardFocusManagerTest.patch
                PerfTest.java

Could somebody apply this patch?
This patch improves the performance of init, get/setDefaultFocusTraversalKeys operations and, also, fixes the issue. 
Below are the results of the attached performance test demonstrating the improvement.

Before applying the patch
init: 32987
get: 3115
set: 32687

init: 32787
get: 3134
set: 32657

init: 32797
get: 3134
set: 17285


After applying the patch
init: 2264
get: 40
set: 19458

init: 2273
get: 40
set: 19578

init: 2313
get: 30
set: 18699

> [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2493
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2493
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>            Priority: Minor
>         Attachments: KeyboardFocusManager.patch, KeyboardFocusManagerTest.patch, PerfTest.java
>
>
> Test case:
> --------------
> import java.awt.AWTEvent;
> import java.awt.Component;
> import java.awt.Container;
> import java.awt.event.KeyEvent;
> import java.util.Set;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         KeyboardFocusManagerImpl obj = new KeyboardFocusManagerImpl();
>         Set keys = obj.getDefaultFocusTraversalKeys(1);
>         assertNotNull(keys);
>         assertTrue(keys.size() > 0);
>     }
>     class KeyboardFocusManagerImpl extends java.awt.KeyboardFocusManager {
>         public KeyboardFocusManagerImpl() {
>             super();
>         }
>         public boolean dispatchEvent(AWTEvent arg0) {
>             return false;
>         }
>         public boolean dispatchKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public boolean postProcessKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public void processKeyEvent(Component arg0, KeyEvent arg1) {
>         }
>         protected void enqueueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void dequeueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void discardKeyEvents(Component arg0) {
>         }
>         public void focusNextComponent(Component arg0) {
>         }
>         public void focusPreviousComponent(Component arg0) {
>         }
>         public void upFocusCycle(Component arg0) {
>         }
>         public void downFocusCycle(Container arg0) {
>         }
>     }
> }
> RI output:
> -------------
> .
> Time: 0,991
> OK (1 test)
> Harmony output:
> --------------
> .F
> Time: 0.361
> There was 1 failure:
> 1) testcase1(TheTest)junit.framework.AssertionFailedError
> 	at TheTest.testcase1(TheTest.java:17)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:12)
> 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

        

[jira] Updated: (HARMONY-2493) [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object

Posted by "Andrey Pavlenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2493?page=all ]

Andrey Pavlenko updated HARMONY-2493:
-------------------------------------

    Attachment: DefaultKeyboardFocusManager.patch

> [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2493
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2493
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>            Priority: Minor
>         Attachments: DefaultKeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManagerTest.patch, PerfTest.java
>
>
> Test case:
> --------------
> import java.awt.AWTEvent;
> import java.awt.Component;
> import java.awt.Container;
> import java.awt.event.KeyEvent;
> import java.util.Set;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         KeyboardFocusManagerImpl obj = new KeyboardFocusManagerImpl();
>         Set keys = obj.getDefaultFocusTraversalKeys(1);
>         assertNotNull(keys);
>         assertTrue(keys.size() > 0);
>     }
>     class KeyboardFocusManagerImpl extends java.awt.KeyboardFocusManager {
>         public KeyboardFocusManagerImpl() {
>             super();
>         }
>         public boolean dispatchEvent(AWTEvent arg0) {
>             return false;
>         }
>         public boolean dispatchKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public boolean postProcessKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public void processKeyEvent(Component arg0, KeyEvent arg1) {
>         }
>         protected void enqueueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void dequeueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void discardKeyEvents(Component arg0) {
>         }
>         public void focusNextComponent(Component arg0) {
>         }
>         public void focusPreviousComponent(Component arg0) {
>         }
>         public void upFocusCycle(Component arg0) {
>         }
>         public void downFocusCycle(Container arg0) {
>         }
>     }
> }
> RI output:
> -------------
> .
> Time: 0,991
> OK (1 test)
> Harmony output:
> --------------
> .F
> Time: 0.361
> There was 1 failure:
> 1) testcase1(TheTest)junit.framework.AssertionFailedError
> 	at TheTest.testcase1(TheTest.java:17)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:12)
> 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

        

[jira] Commented: (HARMONY-2493) [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2493?page=comments#action_12460672 ] 
            
Alexei Zakharov commented on HARMONY-2493:
------------------------------------------

Andrey, I have added  java.awt.KeyboardFocusManagerRTest back to the exclude list for Linux'es since it fails on IBM's CC Linux system. Please see the corresponding "[continuum] BUILD FAILURE: Classlib/linux.ia32 Build/Tes" thread at dev@harmony. Could you please try this on various Linux'es?

> [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2493
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2493
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: BasicTextUI.patch, DefaultKeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManagerRTest.patch, KeyboardFocusManagerTest.patch, PerfTest.java
>
>
> Test case:
> --------------
> import java.awt.AWTEvent;
> import java.awt.Component;
> import java.awt.Container;
> import java.awt.event.KeyEvent;
> import java.util.Set;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         KeyboardFocusManagerImpl obj = new KeyboardFocusManagerImpl();
>         Set keys = obj.getDefaultFocusTraversalKeys(1);
>         assertNotNull(keys);
>         assertTrue(keys.size() > 0);
>     }
>     class KeyboardFocusManagerImpl extends java.awt.KeyboardFocusManager {
>         public KeyboardFocusManagerImpl() {
>             super();
>         }
>         public boolean dispatchEvent(AWTEvent arg0) {
>             return false;
>         }
>         public boolean dispatchKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public boolean postProcessKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public void processKeyEvent(Component arg0, KeyEvent arg1) {
>         }
>         protected void enqueueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void dequeueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void discardKeyEvents(Component arg0) {
>         }
>         public void focusNextComponent(Component arg0) {
>         }
>         public void focusPreviousComponent(Component arg0) {
>         }
>         public void upFocusCycle(Component arg0) {
>         }
>         public void downFocusCycle(Container arg0) {
>         }
>     }
> }
> RI output:
> -------------
> .
> Time: 0,991
> OK (1 test)
> Harmony output:
> --------------
> .F
> Time: 0.361
> There was 1 failure:
> 1) testcase1(TheTest)junit.framework.AssertionFailedError
> 	at TheTest.testcase1(TheTest.java:17)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:12)
> 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

        

[jira] Resolved: (HARMONY-2493) [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2493?page=all ]

Alexei Zakharov resolved HARMONY-2493.
--------------------------------------

    Resolution: Fixed

> [classlib][awt] java.awt.KeyboardFocusManager.getDefaultFocusTraversalKeys() returns null instead of correct object
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2493
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2493
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pavel Dolgov
>         Assigned To: Alexei Zakharov
>            Priority: Minor
>         Attachments: BasicTextUI.patch, DefaultKeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManager.patch, KeyboardFocusManagerRTest.patch, KeyboardFocusManagerTest.patch, PerfTest.java
>
>
> Test case:
> --------------
> import java.awt.AWTEvent;
> import java.awt.Component;
> import java.awt.Container;
> import java.awt.event.KeyEvent;
> import java.util.Set;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
>     public static void main(String args[]) {
>         junit.textui.TestRunner.run(TheTest.class);
>     }
>     public void testcase1() {
>         KeyboardFocusManagerImpl obj = new KeyboardFocusManagerImpl();
>         Set keys = obj.getDefaultFocusTraversalKeys(1);
>         assertNotNull(keys);
>         assertTrue(keys.size() > 0);
>     }
>     class KeyboardFocusManagerImpl extends java.awt.KeyboardFocusManager {
>         public KeyboardFocusManagerImpl() {
>             super();
>         }
>         public boolean dispatchEvent(AWTEvent arg0) {
>             return false;
>         }
>         public boolean dispatchKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public boolean postProcessKeyEvent(KeyEvent arg0) {
>             return false;
>         }
>         public void processKeyEvent(Component arg0, KeyEvent arg1) {
>         }
>         protected void enqueueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void dequeueKeyEvents(long arg0, Component arg1) {
>         }
>         protected void discardKeyEvents(Component arg0) {
>         }
>         public void focusNextComponent(Component arg0) {
>         }
>         public void focusPreviousComponent(Component arg0) {
>         }
>         public void upFocusCycle(Component arg0) {
>         }
>         public void downFocusCycle(Container arg0) {
>         }
>     }
> }
> RI output:
> -------------
> .
> Time: 0,991
> OK (1 test)
> Harmony output:
> --------------
> .F
> Time: 0.361
> There was 1 failure:
> 1) testcase1(TheTest)junit.framework.AssertionFailedError
> 	at TheTest.testcase1(TheTest.java:17)
> 	at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> 	at TheTest.main(TheTest.java:12)
> 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