harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r502292 - in /harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common: javax/swing/ScrollPaneLayout.java org/apache/harmony/x/swing/internal/nls/messages.properties
Date Thu, 01 Feb 2007 17:27:29 GMT
Author: apetrenko
Date: Thu Feb  1 09:27:28 2007
New Revision: 502292

URL: http://svn.apache.org/viewvc?view=rev&rev=502292
Log:
Additional patch for HARMONY-1737 "[classlib][swing] javax.swing.ScrollPaneLayout.setHorisontalScrollBarPolicy(int)
does not throw specified IllegalArgumentException"

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ScrollPaneLayout.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/internal/nls/messages.properties

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ScrollPaneLayout.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ScrollPaneLayout.java?view=diff&rev=502292&r1=502291&r2=502292
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ScrollPaneLayout.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ScrollPaneLayout.java
Thu Feb  1 09:27:28 2007
@@ -33,6 +33,8 @@
 import javax.swing.ScrollPaneConstants;
 import javax.swing.border.Border;
 
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
 public class ScrollPaneLayout implements Serializable, LayoutManager, ScrollPaneConstants
{
 
     public static class UIResource extends ScrollPaneLayout implements javax.swing.plaf.UIResource
{
@@ -120,12 +122,10 @@
     }
 
     public void setVerticalScrollBarPolicy(final int x) {
-        boolean isVertical = ((x == ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED)
-                | (x == ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS) 
-                | (x == ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER));
-        if (!isVertical) {
-            throw new IllegalArgumentException(
-                    "invalid verticalScrollBarPolicy");
+        if (x != ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED &&
+            x != ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS && 
+            x != ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER) {
+            throw new IllegalArgumentException(Messages.getString("swing.02"));
         }
         vsbPolicy = x;
     }
@@ -135,12 +135,10 @@
     }
 
     public void setHorizontalScrollBarPolicy(final int x) {
-        boolean isHorisontal = ((x == ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED)
-                | (x == ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER) 
-                | (x == ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS));
-        if (!isHorisontal) {
-            throw new IllegalArgumentException(
-                    "invalid horizontalScrollBarPolicy");
+        if (x != ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED &&
+            x != ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER && 
+            x != ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS) {
+            throw new IllegalArgumentException(Messages.getString("swing.03")); 
         }
         hsbPolicy = x;
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/internal/nls/messages.properties?view=diff&rev=502292&r1=502291&r2=502292
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/internal/nls/messages.properties
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/internal/nls/messages.properties
Thu Feb  1 09:27:28 2007
@@ -17,3 +17,6 @@
 # messages for EN locale
 swing.00=Invalid axis: {0}
 swing.01=fromIndex must be <= toIndex
+swing.02=invalid verticalScrollBarPolicy
+swing.03=invalid horizontalScrollBarPolicy
+



Mime
View raw message