You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2007/01/13 21:35:18 UTC

svn commit: r495966 - in /harmony/enhanced/classlib/trunk/modules/swing: make/ src/main/java/common/javax/swing/ src/test/api/java/common/javax/swing/

Author: hindessm
Date: Sat Jan 13 12:35:17 2007
New Revision: 495966

URL: http://svn.apache.org/viewvc?view=rev&rev=495966
Log:
Applying patch from "[#HARMONY-2619] [classlib][swing]
javax.swing.LayoutFocusTraversalPolicy.getComponentAfter() throws NPE
instead of IllegalArgumentException".  I also removed this test from the
Linux exclude lists.

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LayoutFocusTraversalPolicy.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LayoutFocusTraversalPolicyTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl?view=diff&rev=495966&r1=495965&r2=495966
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.drl Sat Jan 13 12:35:17 2007
@@ -65,7 +65,6 @@
 javax/swing/JTextFieldTest.java
 javax/swing/JViewportTest.java
 javax/swing/JWindowTest.java
-javax/swing/LayoutFocusTraversalPolicyTest.java
 javax/swing/OverlayLayoutTest.java
 javax/swing/PopupFactoryRTest.java
 javax/swing/PopupFactoryTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm?view=diff&rev=495966&r1=495965&r2=495966
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86.ibm Sat Jan 13 12:35:17 2007
@@ -65,7 +65,6 @@
 javax/swing/JTextFieldTest.java
 javax/swing/JViewportTest.java
 javax/swing/JWindowTest.java
-javax/swing/LayoutFocusTraversalPolicyTest.java
 javax/swing/OverlayLayoutTest.java
 javax/swing/PopupFactoryRTest.java
 javax/swing/PopupFactoryTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl?view=diff&rev=495966&r1=495965&r2=495966
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.drl Sat Jan 13 12:35:17 2007
@@ -68,7 +68,6 @@
 javax/swing/JTextFieldTest.java
 javax/swing/JViewportTest.java
 javax/swing/JWindowTest.java
-javax/swing/LayoutFocusTraversalPolicyTest.java
 javax/swing/OverlayLayoutTest.java
 javax/swing/PopupFactoryRTest.java
 javax/swing/PopupFactoryTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm?view=diff&rev=495966&r1=495965&r2=495966
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.linux.x86_64.ibm Sat Jan 13 12:35:17 2007
@@ -65,7 +65,6 @@
 javax/swing/JTextFieldTest.java
 javax/swing/JViewportTest.java
 javax/swing/JWindowTest.java
-javax/swing/LayoutFocusTraversalPolicyTest.java
 javax/swing/OverlayLayoutTest.java
 javax/swing/PopupFactoryRTest.java
 javax/swing/PopupFactoryTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl?view=diff&rev=495966&r1=495965&r2=495966
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.drl Sat Jan 13 12:35:17 2007
@@ -69,7 +69,6 @@
 javax/swing/JTextFieldTest.java
 javax/swing/JViewportTest.java
 javax/swing/JWindowTest.java
-javax/swing/LayoutFocusTraversalPolicyTest.java
 javax/swing/OverlayLayoutTest.java
 javax/swing/PopupFactoryRTest.java
 javax/swing/PopupFactoryTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm?view=diff&rev=495966&r1=495965&r2=495966
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm Sat Jan 13 12:35:17 2007
@@ -76,7 +76,6 @@
 javax/swing/JTextFieldTest.java
 javax/swing/JViewportTest.java
 javax/swing/JWindowTest.java
-javax/swing/LayoutFocusTraversalPolicyTest.java
 javax/swing/OverlayLayoutTest.java
 javax/swing/PopupFactoryRTest.java
 javax/swing/PopupFactoryTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl?view=diff&rev=495966&r1=495965&r2=495966
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.drl Sat Jan 13 12:35:17 2007
@@ -65,7 +65,6 @@
 javax/swing/JTextFieldTest.java
 javax/swing/JViewportTest.java
 javax/swing/JWindowTest.java
-javax/swing/LayoutFocusTraversalPolicyTest.java
 javax/swing/OverlayLayoutTest.java
 javax/swing/PopupFactoryRTest.java
 javax/swing/PopupFactoryTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm?view=diff&rev=495966&r1=495965&r2=495966
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86_64.ibm Sat Jan 13 12:35:17 2007
@@ -65,7 +65,6 @@
 javax/swing/JTextFieldTest.java
 javax/swing/JViewportTest.java
 javax/swing/JWindowTest.java
-javax/swing/LayoutFocusTraversalPolicyTest.java
 javax/swing/OverlayLayoutTest.java
 javax/swing/PopupFactoryRTest.java
 javax/swing/PopupFactoryTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LayoutFocusTraversalPolicy.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LayoutFocusTraversalPolicy.java?view=diff&rev=495966&r1=495965&r2=495966
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LayoutFocusTraversalPolicy.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/LayoutFocusTraversalPolicy.java Sat Jan 13 12:35:17 2007
@@ -40,21 +40,39 @@
     }
 
     public Component getComponentBefore(final Container focusCycleRoot, final Component component) {
+        if (focusCycleRoot == null) {
+            throw new IllegalArgumentException("focusCycleRoot must not be null");
+        }
+        if (component == null) {
+            throw new IllegalArgumentException("component must not be null");
+        }
         ((LayoutComparator)getComparator()).setOrientation(focusCycleRoot.getComponentOrientation());
         return super.getComponentBefore(focusCycleRoot, component);
     }
 
     public Component getComponentAfter(final Container focusCycleRoot, final Component component) {
+        if (focusCycleRoot == null) {
+            throw new IllegalArgumentException("focusCycleRoot must not be null");
+        }
+        if (component == null) {
+            throw new IllegalArgumentException("component must not be null");
+        }
         ((LayoutComparator)getComparator()).setOrientation(focusCycleRoot.getComponentOrientation());
         return super.getComponentAfter(focusCycleRoot, component);
     }
 
     public Component getLastComponent(final Container focusCycleRoot) {
+        if (focusCycleRoot == null) {
+            throw new IllegalArgumentException("focusCycleRoot must not be null");
+        }
         ((LayoutComparator)getComparator()).setOrientation(focusCycleRoot.getComponentOrientation());
         return super.getLastComponent(focusCycleRoot);
     }
 
     public Component getFirstComponent(final Container focusCycleRoot) {
+        if (focusCycleRoot == null) {
+            throw new IllegalArgumentException("focusCycleRoot must not be null");
+        }
         ((LayoutComparator)getComparator()).setOrientation(focusCycleRoot.getComponentOrientation());
         return super.getFirstComponent(focusCycleRoot);
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LayoutFocusTraversalPolicyTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LayoutFocusTraversalPolicyTest.java?view=diff&rev=495966&r1=495965&r2=495966
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LayoutFocusTraversalPolicyTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LayoutFocusTraversalPolicyTest.java Sat Jan 13 12:35:17 2007
@@ -116,6 +116,31 @@
         assertEquals(button4, policy.getComponentBefore(cycleRoot, button1));
     }
 
+    public void testGetComponentBefore_Null() throws Exception {
+        JPanel cycleRoot = createTestPanel(ComponentOrientation.LEFT_TO_RIGHT);
+
+        try {
+            policy.getComponentBefore(cycleRoot, null);
+            fail("IllegalArgumentException should have been thrown");
+        } catch (IllegalArgumentException e) {
+            // Expected
+        }
+
+        try {
+            policy.getComponentBefore(null, button1);
+            fail("IllegalArgumentException should have been thrown");
+        } catch (IllegalArgumentException e) {
+            // Expected
+        }
+
+        try {
+            policy.getComponentBefore(null, null);
+            fail("IllegalArgumentException should have been thrown");
+        } catch (IllegalArgumentException e) {
+            // Expected
+        }
+    }
+
     public void testGetComponentAfter() throws Exception {
         JPanel cycleRoot = createTestPanel(ComponentOrientation.LEFT_TO_RIGHT);
         assertEquals(button1, policy.getComponentAfter(cycleRoot, button4));
@@ -129,6 +154,31 @@
         assertEquals(button4, policy.getComponentAfter(cycleRoot, button3));
     }
 
+    public void testGetComponentAfter_Null() throws Exception {
+        JPanel cycleRoot = createTestPanel(ComponentOrientation.LEFT_TO_RIGHT);
+
+        try {
+            policy.getComponentAfter(cycleRoot, null);
+            fail("IllegalArgumentException should have been thrown");
+        } catch (IllegalArgumentException e) {
+            // Expected
+        }
+
+        try {
+            policy.getComponentAfter(null, button1);
+            fail("IllegalArgumentException should have been thrown");
+        } catch (IllegalArgumentException e) {
+            // Expected
+        }
+
+        try {
+            policy.getComponentAfter(null, null);
+            fail("IllegalArgumentException should have been thrown");
+        } catch (IllegalArgumentException e) {
+            // Expected
+        }
+    }
+
     public void testGetLastComponent() throws Exception {
         JPanel cycleRoot = createTestPanel(ComponentOrientation.LEFT_TO_RIGHT);
         assertEquals(button1, policy.getLastComponent(cycleRoot));
@@ -136,11 +186,33 @@
         assertEquals(button1, policy.getLastComponent(cycleRoot));
     }
 
+    public void testGetLastComponent_Null() throws Exception {
+        JPanel cycleRoot = createTestPanel(ComponentOrientation.LEFT_TO_RIGHT);
+
+        try {
+            policy.getLastComponent(null);
+            fail("IllegalArgumentException should have been thrown");
+        } catch (IllegalArgumentException e) {
+            // Expected
+        }
+    }
+
     public void testGetFirstComponent() throws Exception {
         JPanel cycleRoot = createTestPanel(ComponentOrientation.LEFT_TO_RIGHT);
         assertEquals(button2, policy.getFirstComponent(cycleRoot));
         cycleRoot = createTestPanel(ComponentOrientation.RIGHT_TO_LEFT);
         assertEquals(button2, policy.getFirstComponent(cycleRoot));
+    }
+
+    public void testGetFirstComponent_Null() throws Exception {
+        JPanel cycleRoot = createTestPanel(ComponentOrientation.LEFT_TO_RIGHT);
+
+        try {
+            policy.getFirstComponent(null);
+            fail("IllegalArgumentException should have been thrown");
+        } catch (IllegalArgumentException e) {
+            // Expected
+        }
     }
 
     private JPanel createTestPanel(final ComponentOrientation co) throws Exception {