harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r668658 - /harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
Date Tue, 17 Jun 2008 13:30:25 GMT
Author: hindessm
Date: Tue Jun 17 06:30:25 2008
New Revision: 668658

URL: http://svn.apache.org/viewvc?rev=668658&view=rev
Log:
Applying slightly modified version of patch for "[#HARMONY-5875] Fixes a
problem in JComponent that fails JComponentTest.testSetInputMap()".

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java?rev=668658&r1=668657&r2=668658&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
Tue Jun 17 06:30:25 2008
@@ -330,7 +330,10 @@
     private static final String ILLEGAL_CONDITION_MESSAGE = 
             Messages.getString("swing.B3","JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED
", //$NON-NLS-1$ //$NON-NLS-2$
                     "JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT"); //$NON-NLS-1$ 
-
+    
+    private static final String NULL_MAP_MESSAGE =
+            Messages.getString("swing.03", "map"); //$NON-NLS-1$ //$NON-NLS-2$
+    
     private boolean opaque;
 
     private boolean doubleBuffered;
@@ -687,6 +690,9 @@
         if (condition < FIRST_INPUT_MAP_INDEX || condition > LAST_INPUT_MAP_INDEX)
{
             throw new IllegalArgumentException(ILLEGAL_CONDITION_MESSAGE);
         }
+        if (condition == WHEN_IN_FOCUSED_WINDOW && map == null) {
+                	throw new IllegalArgumentException(NULL_MAP_MESSAGE);
+        }
         inputMaps[condition] = map;
         inputMapsCreated[condition] = true;
     }



Mime
View raw message