harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r495860 - in /harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/Component.java test/api/java/common/java/awt/ComponentRTest.java
Date Sat, 13 Jan 2007 09:46:57 GMT
Author: hindessm
Date: Sat Jan 13 01:46:56 2007
New Revision: 495860

URL: http://svn.apache.org/viewvc?view=rev&rev=495860
Log:
Applied patches from "[#HARMONY-2456] [classlib][awt]
java.awt.DefaultFocusManager.upFocusCycle(Component aComponent)
throws unexpected NPE".

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/ComponentRTest.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java?view=diff&rev=495860&r1=495859&r2=495860
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java
Sat Jan 13 01:46:56 2007
@@ -3170,10 +3170,15 @@
         toolkit.lockAWT();
         try {
             KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
-            Container root = kfm.getCurrentFocusCycleRoot(), newRoot = null;
+            Container root = kfm.getCurrentFocusCycleRoot();
+            
+            if(root == null) {
+                return;
+            }
+            
             boolean success = false;
             Component nextComp = null;
-            newRoot = root;
+            Container newRoot = root;
             do {
                 nextComp = newRoot instanceof Window ? newRoot.getFocusTraversalPolicy()
                         .getDefaultComponent(newRoot) : newRoot;

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/ComponentRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/ComponentRTest.java?view=diff&rev=495860&r1=495859&r2=495860
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/ComponentRTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/java/awt/ComponentRTest.java
Sat Jan 13 01:46:56 2007
@@ -73,6 +73,11 @@
         comp.removeNotify();
         assertEquals(size, comp.getMinimumSize());
     }
+    
+    public void testTransferFocusUpCycle() {
+        // Regression test for HARMONY-2456
+        new Button().transferFocusUpCycle();
+    }
 
     public static void main(String[] args) {
         junit.textui.TestRunner.run(ComponentRTest.class);



Mime
View raw message