harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r503794 - in /harmony/enhanced/classlib/trunk/modules/swing: make/exclude.windows.x86.ibm src/main/java/common/javax/swing/border/BevelBorder.java src/test/api/java/common/javax/swing/border/BevelBorderTest.java
Date Mon, 05 Feb 2007 18:11:31 GMT
Author: ayza
Date: Mon Feb  5 10:11:30 2007
New Revision: 503794

URL: http://svn.apache.org/viewvc?view=rev&rev=503794
Log:
Applying patch from HARMONY-2590 ([classlib][swing][plaf] javax.swing.plaf.BorderUIResource.BevelBorderUIResource(int)
throws unspecified InvalidParameterException)

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/border/BevelBorder.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/border/BevelBorderTest.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=503794&r1=503793&r2=503794
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/make/exclude.windows.x86.ibm Mon Feb  5
10:11:30 2007
@@ -3,7 +3,6 @@
 javax/swing/JSpinnerTest.java
 javax/swing/Timer_MultithreadedTest.java
 javax/swing/TransferHandlerTest.java
-javax/swing/border/BevelBorderTest.java
 javax/swing/border/CompoundBorderTest.java
 javax/swing/border/EtchedBorderTest.java
 javax/swing/border/LineBorderTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/border/BevelBorder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/border/BevelBorder.java?view=diff&rev=503794&r1=503793&r2=503794
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/border/BevelBorder.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/border/BevelBorder.java
Mon Feb  5 10:11:30 2007
@@ -24,7 +24,7 @@
 import java.awt.Component;
 import java.awt.Graphics;
 import java.awt.Insets;
-import java.security.InvalidParameterException;
+
 
 public class BevelBorder extends AbstractBorder {
 
@@ -41,27 +41,20 @@
     protected Color shadowOuter;
 
     public BevelBorder(final int bevelType) {
-        setBevelType(bevelType);
+        this.bevelType = bevelType;
     }
 
     public BevelBorder(final int bevelType, final Color highlightOuterColor, final Color
highlightInnerColor, final Color shadowOuterColor, final Color shadowInnerColor) {
+        this(bevelType);
+
         if (highlightOuterColor == null || highlightInnerColor == null ||
                 shadowOuterColor == null || shadowInnerColor == null) {
             throw new NullPointerException("Color should not be null");
         }
-
-        setBevelType(bevelType);
         highlightOuter = highlightOuterColor;
         highlightInner = highlightInnerColor;
         shadowOuter = shadowOuterColor;
         shadowInner = shadowInnerColor;
-    }
-
-    private void setBevelType(final int bevelType) {
-        if (bevelType != RAISED && bevelType != LOWERED) {
-            throw new InvalidParameterException("Incorrect type of the bevel border");
-        }
-        this.bevelType = bevelType;
     }
 
     public BevelBorder(final int bevelType, final Color highlight, final Color shadow) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/border/BevelBorderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/border/BevelBorderTest.java?view=diff&rev=503794&r1=503793&r2=503794
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/border/BevelBorderTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/border/BevelBorderTest.java
Mon Feb  5 10:11:30 2007
@@ -478,4 +478,11 @@
         assertEquals("Deserialized values coinsides", resurrectedBorder
                 .getHighlightOuterColor(), border2.getHighlightOuterColor());
     }
+
+    public void testBevelType() throws Exception {
+        // Regression test for HARMONY-2590
+        for (int i = -10; i < 10; i++) {
+             new BevelBorder(i);
+        }
+    }
 }



Mime
View raw message