harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r496051 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicProgressBarUI.java test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java
Date Sun, 14 Jan 2007 09:57:34 GMT
Author: hindessm
Date: Sun Jan 14 01:57:33 2007
New Revision: 496051

URL: http://svn.apache.org/viewvc?view=rev&rev=496051
Log:
Applying patches from "[#HARMONY-2701] [classlib][swing]
javax.swing.plaf.basic.BasicProgressBarUI.getBoxLength(int, int) returns
value greater than RI returns".

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicProgressBarUI.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicProgressBarUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicProgressBarUI.java?view=diff&rev=496051&r1=496050&r2=496051
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicProgressBarUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicProgressBarUI.java
Sun Jan 14 01:57:33 2007
@@ -262,7 +262,7 @@
     }
 
     protected int getBoxLength(final int length, final int otherDimension) {
-        return length / 6 + 1;
+        return length / 6;
     }
 
     protected void paintIndeterminate(final Graphics g, final JComponent c) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java?view=diff&rev=496051&r1=496050&r2=496051
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java
Sun Jan 14 01:57:33 2007
@@ -133,6 +133,28 @@
         progressBar.setIndeterminate(true);
         assertEquals(0, ui.getAnimationIndex());
     }
+    
+    /**
+     * Regression test for HARMONY-2701 
+     * */
+    public void testGetBoxLength() { 
+        testBasicProgressBarUI pb = new testBasicProgressBarUI(); 
+        assertEquals(0, pb.getBoxLength(0, 1)); 
+    } 
+
+    /**
+     * Regression test for HARMONY-2701 
+     * */
+    public void testGetBoxLength2() { 
+        testBasicProgressBarUI pb = new testBasicProgressBarUI(); 
+        assertEquals(8, pb.getBoxLength(50, 1)); 
+    }  
+
+    class testBasicProgressBarUI extends BasicProgressBarUI { 
+        public int getBoxLength(int a, int b) { 
+            return super.getBoxLength(a, b); 
+        } 
+    }
 
     public void testStartStop() throws NullPointerException {
         BasicProgressBarUIExt pb = new BasicProgressBarUIExt();



Mime
View raw message