You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rw...@apache.org on 2003/12/01 17:40:11 UTC

cvs commit: jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor TestAll.java

rwaldhoff    2003/12/01 08:40:11

  Modified:    functor/src/test/org/apache/commons/functor/example/kata/two
                        TestBinaryChop.java
               functor/src/test/org/apache/commons/functor TestAll.java
  Removed:     functor/src/java/org/apache/commons/functor/util
                        BinarySearch.java
               functor/src/test/org/apache/commons/functor/util
                        TestBinarySearch.java TestAll.java
  Log:
  removing BinarySearch because:
  
  * the functionality is readily available in
    Collections.binarySearch and Arrays.binarySearch
  
  * as a O(log2(N)) algorithm, it's not a strong candidate
    for a tail recusive implemenation anyway
  
  * the current implemenation trades a small stack size for
    a small number of newly allocated Objects, so it's not
    clear that there is a space savings anyway
  
  * since I fixed an obtrusive bug yesterday, I assume it's
    not really being used
  
  * as evidenced by being the only class in the util
    package, it seems out of place for the functor library
  
  Revision  Changes    Path
  1.4       +4 -15     jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/example/kata/two/TestBinaryChop.java
  
  Index: TestBinaryChop.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/example/kata/two/TestBinaryChop.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestBinaryChop.java	1 Dec 2003 08:27:54 -0000	1.3
  +++ TestBinaryChop.java	1 Dec 2003 16:40:11 -0000	1.4
  @@ -65,7 +65,6 @@
   import org.apache.commons.functor.Algorithms;
   import org.apache.commons.functor.Function;
   import org.apache.commons.functor.generator.util.IntegerRange;
  -import org.apache.commons.functor.util.BinarySearch;
   
   /**
    * See http://pragprog.com/pragdave/Practices/Kata/KataTwo.rdoc,v
  @@ -194,7 +193,7 @@
                   }
               });    
       }    
  -    public void testExplicitTailRecursive() {
  +    public void testTailRecursive() {
           chopTest(
               new BaseBinaryChop() {
                   public int find(final Object seeking, final List list) { 
  @@ -223,15 +222,5 @@
                           })).intValue();
                   }                   
               });    
  -    }
  -    
  -    public void testImplicitTailRecursive() {
  -        chopTest(
  -            new BaseBinaryChop() {
  -                public int find(Object seeking, List list) { 
  -                    return BinarySearch.execute(list,(Comparable)seeking);
  -                }                   
  -            });    
  -    }
  -    
  +    }    
   }
  
  
  
  1.6       +2 -3      jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/TestAll.java
  
  Index: TestAll.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/functor/src/test/org/apache/commons/functor/TestAll.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestAll.java	30 Jun 2003 22:40:08 -0000	1.5
  +++ TestAll.java	1 Dec 2003 16:40:11 -0000	1.6
  @@ -78,7 +78,6 @@
           // sub-packages
           suite.addTest(org.apache.commons.functor.adapter.TestAll.suite());
           suite.addTest(org.apache.commons.functor.core.TestAll.suite());
  -        suite.addTest(org.apache.commons.functor.util.TestAll.suite());
           suite.addTest(org.apache.commons.functor.generator.TestAll.suite());
           suite.addTest(org.apache.commons.functor.example.TestAll.suite());
           
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org