DO NOT REPLY [Bug 24911] - last substring returned by StringUtils.split( String, String, int ) is too long

2003-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24911.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24911

last substring returned by StringUtils.split( String, String, int ) is too long





--- Additional Comments From [EMAIL PROTECTED]  2003-11-23 07:42 ---
Sorry, the patch was too big to easily pinpoint the changes to the tests that
demonstrate my desired behavior for the existing methods.  They're actually in
innerTestSplit():

-assertEquals(msg, str, res[0]);
+assertEquals(msg, a, res[0]);

-assertEquals(msg, str.substring(2), res[1]);
+assertEquals(msg, b, res[1]);

I agree the above is a change to the contract of these methods; I wanted to
raise the question as to whether the existing contract is the most
useful/sensible one.  It sure surprised me that the last substring returned by
the method had different properties from the others.  It doesn't make sense to
me, but maybe it does to other people.  If so, that's fine.


Furthermore, the Javadoc example

StringUtils.split(ab:cd:ef, :, 2)= [ab, cdef]

should read

StringUtils.split(ab:cd:ef, :, 2)= [ab, cd:ef]

in order to reflect what the code currently does (what it does is in some sense
sensible, though not what I would expect).  What the Javadoc says is just plain
weird, but I assume it was a typo.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [site] Non-Maven web sites

2003-11-23 Thread Henri Yandell

How about:

jakarta-site2/commons ?

Hen

On Sat, 22 Nov 2003, Dirk Verbeeck wrote:

 How about creating a jakarta-commons-site for the generated html.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/io project.xml

2003-11-23 Thread bayard
bayard  2003/11/23 00:04:07

  Modified:io   project.xml
  Log:
  moving to 3.8.1 to get assertFalse
  
  Revision  ChangesPath
  1.12  +1 -1  jakarta-commons-sandbox/io/project.xml
  
  Index: project.xml
  ===
  RCS file: /home/cvs/jakarta-commons-sandbox/io/project.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- project.xml   17 Oct 2003 20:16:18 -  1.11
  +++ project.xml   23 Nov 2003 08:04:06 -  1.12
  @@ -155,7 +155,7 @@
   dependencies
   dependency
   idjunit/id
  -version3.7/version
  +version3.8.1/version
   /dependency
   /dependencies
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[io] Current plan?

2003-11-23 Thread Henri Yandell

Jeremias et al,

Just wanted to ask what the current plan was for Commons IO. Do you have a
todo list anywhere that you're working from?

Is there anywhere I can help?

Hen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [io] Current plan?

2003-11-23 Thread Henri Yandell

Just in case it's of use, I knocked out a clover report for IO. Have
recently reinstalled the machine, so the commons licence for clover is not
setup.

http://www.apache.org/~bayard/io-clover/

Hen

On Sun, 23 Nov 2003, Henri Yandell wrote:


 Jeremias et al,

 Just wanted to ask what the current plan was for Commons IO. Do you have a
 todo list anywhere that you're working from?

 Is there anywhere I can help?

 Hen


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[general][io][bzip2] BZip2, Tar and Zip libraries

2003-11-23 Thread Henri Yandell

Commons-IO contains a tar package and a zip package under a compress
package.

Both came from Avalon's Excalibur, but originally from Ant, as far as
life in Apache goes. The tar package is originally Tim Endres' public
domain package.

Both are available at:

http://cvs.apache.org/viewcvs/ant/src/main/org/apache/tools/

I would like to remove these from Commons-IO, as they don't really fit
there. I also wonder if the Commons-BZip2 component is worth keeping there
or if it should be removed.

Does anyone mind?

Does anyone have a better idea as to where they could live? Ant-tools
seems most likely to be the definitive location for bzip2, tar and zip.

Hen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/io/src/java/org/apache/commons/io/input ProxyInputStream.java

2003-11-23 Thread bayard
bayard  2003/11/23 00:34:34

  Modified:io/src/java/org/apache/commons/io/input
ProxyInputStream.java
  Log:
  added a slightly better reason for why this class is of importance
  
  Revision  ChangesPath
  1.3   +2 -1  
jakarta-commons-sandbox/io/src/java/org/apache/commons/io/input/ProxyInputStream.java
  
  Index: ProxyInputStream.java
  ===
  RCS file: 
/home/cvs/jakarta-commons-sandbox/io/src/java/org/apache/commons/io/input/ProxyInputStream.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ProxyInputStream.java 13 Oct 2003 07:04:16 -  1.2
  +++ ProxyInputStream.java 23 Nov 2003 08:34:34 -  1.3
  @@ -61,7 +61,8 @@
* A Proxy stream which acts as expected, that is it passes the method 
* calls on to the proxied stream and doesn't change which methods are 
* being called. It is an alternative base class to FilterInputStream
  - * to increase reusability.
  + * to increase reusability, because FilterInputStream changes the 
  + * methods being called, such as read(byte[]) to read(byte[], int, int).
*/
   public abstract class ProxyInputStream extends FilterInputStream {
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/io/src/test/org/apache/commons/io/filefilter FileFilterTestCase.java

2003-11-23 Thread bayard
bayard  2003/11/23 00:35:14

  Modified:io/src/test/org/apache/commons/io/filefilter
FileFilterTestCase.java
  Log:
  added a set of tests for when NameFileFilter is created with a List
  
  Revision  ChangesPath
  1.12  +9 -0  
jakarta-commons-sandbox/io/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
  
  Index: FileFilterTestCase.java
  ===
  RCS file: 
/home/cvs/jakarta-commons-sandbox/io/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- FileFilterTestCase.java   22 Nov 2003 20:08:23 -  1.11
  +++ FileFilterTestCase.java   23 Nov 2003 08:35:14 -  1.12
  @@ -164,6 +164,15 @@
   assertFiltering(filter, new File(bar), true);
   assertFiltering(filter, new File(fred), false);
   
  +// repeat for a List
  +java.util.ArrayList list = new java.util.ArrayList();
  +list.add(foo);
  +list.add(bar);
  +filter = new NameFileFilter(list);
  +assertFiltering(filter, new File(foo), true);
  +assertFiltering(filter, new File(bar), true);
  +assertFiltering(filter, new File(fred), false);
  +
   filter = new NameFileFilter(foo);
   assertFiltering(filter, new File(foo), true);
   assertFiltering(filter, new File(FOO), false); //case-sensitive
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/io/src/java/org/apache/commons/io/input CountingInputStream.java

2003-11-23 Thread bayard
bayard  2003/11/23 01:18:55

  Modified:io/src/java/org/apache/commons/io/input
CountingInputStream.java
  Log:
  modified so that when a read(byte[]) method returns a different number of bytes read 
than requested, the count is correct
  
  Revision  ChangesPath
  1.4   +8 -6  
jakarta-commons-sandbox/io/src/java/org/apache/commons/io/input/CountingInputStream.java
  
  Index: CountingInputStream.java
  ===
  RCS file: 
/home/cvs/jakarta-commons-sandbox/io/src/java/org/apache/commons/io/input/CountingInputStream.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CountingInputStream.java  13 Oct 2003 07:04:16 -  1.3
  +++ CountingInputStream.java  23 Nov 2003 09:18:55 -  1.4
  @@ -64,7 +64,7 @@
* @author a href=mailto:[EMAIL PROTECTED]Henri Yandell/a
* @version $Id$
*/
  -public class CountingInputStream extends FilterInputStream {
  +public class CountingInputStream extends ProxyInputStream {
   
   private int count;
   
  @@ -78,14 +78,16 @@
   
   /** @see java.io.InputStream#read(byte[]) */
   public int read(byte[] b) throws IOException {
  -count += b.length;
  -return super.read(b);
  +int found = super.read(b);
  +count += found;
  +return found;
   }
   
   /** @see java.io.InputStream#read(byte[], int, int) */
   public int read(byte[] b, int off, int len) throws IOException {
  -count += len;
  -return super.read(b, off, len);
  +int found = super.read(b, off, len);
  +count += found;
  +return found;
   }
   
   /** @see java.io.InputStream#read() */
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/io/src/java/org/apache/commons/io/input CountingInputStream.java

2003-11-23 Thread bayard
bayard  2003/11/23 01:20:21

  Modified:io/src/java/org/apache/commons/io/input
CountingInputStream.java
  Log:
  count to this.count so I can point out a change in the last commit from Filter to 
Proxy stream. FilterStream does not correctly proxy methods but optimises.
  
  Revision  ChangesPath
  1.5   +4 -4  
jakarta-commons-sandbox/io/src/java/org/apache/commons/io/input/CountingInputStream.java
  
  Index: CountingInputStream.java
  ===
  RCS file: 
/home/cvs/jakarta-commons-sandbox/io/src/java/org/apache/commons/io/input/CountingInputStream.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CountingInputStream.java  23 Nov 2003 09:18:55 -  1.4
  +++ CountingInputStream.java  23 Nov 2003 09:20:20 -  1.5
  @@ -79,20 +79,20 @@
   /** @see java.io.InputStream#read(byte[]) */
   public int read(byte[] b) throws IOException {
   int found = super.read(b);
  -count += found;
  +this.count += found;
   return found;
   }
   
   /** @see java.io.InputStream#read(byte[], int, int) */
   public int read(byte[] b, int off, int len) throws IOException {
   int found = super.read(b, off, len);
  -count += found;
  +this.count += found;
   return found;
   }
   
   /** @see java.io.InputStream#read() */
   public int read() throws IOException {
  -count++;
  +this.count++;
   return super.read();
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/io/src/test/org/apache/commons/io/input CountingInputStreamTest.java

2003-11-23 Thread bayard
bayard  2003/11/23 01:20:54

  Added:   io/src/test/org/apache/commons/io/input
CountingInputStreamTest.java
  Log:
  unit test for counting input stream
  
  Revision  ChangesPath
  1.1  
jakarta-commons-sandbox/io/src/test/org/apache/commons/io/input/CountingInputStreamTest.java
  
  Index: CountingInputStreamTest.java
  ===
  /*
   * $Header: 
/home/cvs/jakarta-commons-sandbox/io/src/test/org/apache/commons/io/input/CountingInputStreamTest.java,v
 1.1 2003/11/23 09:20:54 bayard Exp $
   * $Revision: 1.1 $
   * $Date: 2003/11/23 09:20:54 $
   *
   * 
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *any, must include the following acknowledgement:
   *   This product includes software developed by the
   *Apache Software Foundation (http://www.apache.org/).
   *Alternately, this acknowledgement may appear in the software itself,
   *if and wherever such third-party acknowledgements normally appear.
   *
   * 4. The names The Jakarta Project, Commons, and Apache Software
   *Foundation must not be used to endorse or promote products derived
   *from this software without prior written permission. For written
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called Apache
   *nor may Apache appear in their names without prior written
   *permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * 
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * http://www.apache.org/.
   *
   */
  
  package org.apache.commons.io.input;
  
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.ByteArrayInputStream;
  
  import junit.framework.TestCase;
  
  /**
   * Tests the CountingInputStream.
   *
   * @author a href=mailto:[EMAIL PROTECTED]Henri Yandell/a
   */
  public final class CountingInputStreamTest extends TestCase {
  
  public CountingInputStreamTest(String name) {
  super(name);
  }
  
  public void testCounting() throws Exception {
  String text = A piece of text;
  byte[] bytes = text.getBytes();
  ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
  CountingInputStream cis = new CountingInputStream(bais);
  
  // have to declare this larger as we're going to read 
  // off the end of the stream and input stream seems 
  // to do bounds checking
  byte[] result = new byte[21];
  
  byte[] ba = new byte[5];
  int found = cis.read(ba);
  System.arraycopy(ba, 0, result, 0, 5);
  assertEquals( found, cis.getCount() );
  
  int value = cis.read();
  found++; 
  result[5] = (byte)value;
  assertEquals( found, cis.getCount() );
  
  found += cis.read(result, 6, 5);
  assertEquals( found, cis.getCount() );
  
  found += cis.read(result, 11, 10); // off the end
  assertEquals( found, cis.getCount() );
  
  // trim to get rid of the 6 empty values
  String textResult = new String(result).trim();

Re: [io] Current plan?

2003-11-23 Thread Henri Yandell

Clover's already on the IO site :) Idiot me.

Hen

On Sun, 23 Nov 2003, Henri Yandell wrote:


 Just in case it's of use, I knocked out a clover report for IO. Have
 recently reinstalled the machine, so the commons licence for clover is not
 setup.

 http://www.apache.org/~bayard/io-clover/

 Hen

 On Sun, 23 Nov 2003, Henri Yandell wrote:

 
  Jeremias et al,
 
  Just wanted to ask what the current plan was for Commons IO. Do you have a
  todo list anywhere that you're working from?
 
  Is there anywhere I can help?
 
  Hen
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/io/src/test/org/apache/commons/io/output CountingOutputStreamTest.java TeeOutputStreamTest.java

2003-11-23 Thread bayard
bayard  2003/11/23 01:32:45

  Added:   io/src/test/org/apache/commons/io/output
CountingOutputStreamTest.java
TeeOutputStreamTest.java
  Log:
  tests added for CountingOutputStream and TeeOutputStream
  
  Revision  ChangesPath
  1.1  
jakarta-commons-sandbox/io/src/test/org/apache/commons/io/output/CountingOutputStreamTest.java
  
  Index: CountingOutputStreamTest.java
  ===
  /*
   * $Header: 
/home/cvs/jakarta-commons-sandbox/io/src/test/org/apache/commons/io/output/CountingOutputStreamTest.java,v
 1.1 2003/11/23 09:32:45 bayard Exp $
   * $Revision: 1.1 $
   * $Date: 2003/11/23 09:32:45 $
   *
   * 
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *any, must include the following acknowlegement:
   *   This product includes software developed by the
   *Apache Software Foundation (http://www.apache.org/).
   *Alternately, this acknowlegement may appear in the software itself,
   *if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names The Jakarta Project, Commons, and Apache Software
   *Foundation must not be used to endorse or promote products derived
   *from this software without prior written permission. For written
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called Apache
   *nor may Apache appear in their names without prior written
   *permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * 
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * http://www.apache.org/.
   *
   */
  
  
  package org.apache.commons.io.output;
  
  
  import java.io.ByteArrayOutputStream;
  import java.io.IOException;
  
  import junit.framework.TestCase;
  
  
  /**
   * @author Henri Yandell (bayard at apache dot org)
   * @version $Revision: 1.1 $ $Date: 2003/11/23 09:32:45 $
   */
  
  public class CountingOutputStreamTest extends TestCase {
  
  public CountingOutputStreamTest(String name) {
  super(name);
  }
  
  public void testCounting() throws IOException {
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  CountingOutputStream cos = new CountingOutputStream(baos);
  
  for(int i = 0; i  20; i++) {
  cos.write(i);
  }
  assertByteArrayEquals(CountingOutputStream.write(int), baos.toByteArray(), 
0, 20);
  assertEquals(CountingOutputStream.getCount(), cos.getCount(), 20);
  
  byte[] array = new byte[10];
  for(int i = 20; i  30; i++) {
  array[i-20] = (byte)i;
  }
  cos.write(array);
  assertByteArrayEquals(CountingOutputStream.write(byte[]), 
baos.toByteArray(), 0, 30);
  assertEquals(CountingOutputStream.getCount(), cos.getCount(), 30);
  
  for(int i = 25; i  35; i++) {
  array[i-25] = (byte)i;
  }
  cos.write(array, 5, 5);
  assertByteArrayEquals(CountingOutputStream.write(byte[], int, int), 
baos.toByteArray(), 0, 35);
  

[io] remove old ant build system

2003-11-23 Thread Henri Yandell

As the site is using maven, is there any need to keep the old build
system? [build.properties, build.properties.sample, build.xml]

It'll only get out of date if maven is the main build system [and vice
versa].

Hen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [site] Non-Maven web sites

2003-11-23 Thread robert burrell donkin
On 22 Nov 2003, at 21:36, Phil Steitz wrote:
robert burrell donkin wrote:
snip

i'd personally find it very difficult to read all the commit mails 
from all the components in jakarta-commons if we started storing the 
sites in maven. this would raise questions about whether 
jakarta-commons can be properly supervised.
It seems silly to me that supervising the site means reading HTML 
diffs.  The xdoc diffs contain all of the relevant changes and, like 
code changes, the best way to validate changes is to update and build 
locally. I understand the argument about disaster recovery, but there 
are other (standard) ways to deal with that.
supervising the source code means reading all commit messages. the 
ability to read each and every commit message from jakarta-commons is a 
crucial part of supervision. the jakarta pmc is responsible for legal 
oversight. it might seem silly to you but being able to effectively 
review all changes is a crucial part of that oversight.

as a jakarta-commons committer, you should really read every commit 
email for each component that you're interested in. all commits are 
approved collectively by lazy consensus. if you have any reservations 
about any change, you can post a -1 against the cvs commit email. you 
should definitely -1 if you see any content that may put the ASF at 
risk.

- robert

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [io] Current plan?

2003-11-23 Thread Jeremias Maerki
Henri,

thanks for helping out. I'm just scratching together some time now and
then to bring IO forward. Mostly hacking on it while travelling by train.

We've got some kind of todo list in the status.html. My changes in the
filefilter package weren't in there but were triggered my my rewriting
listFiles(). And the FileUtils todo entry merely says FileUtils: This
class is a big mess ATM. We need to clean it up. which is really all
there was to say. Now it's already better and one of the next steps is
to create a FilenameUtils class with methods for people who work with
filenames instead of java.io.File. FileUtils is reserved for
java.io.File.

I'll update status.html soon to reflect what I was doing and I see need
doing.

On 23.11.2003 09:07:48 Henri Yandell wrote:
 Just wanted to ask what the current plan was for Commons IO. Do you have a
 todo list anywhere that you're working from?
 
 Is there anywhere I can help?

Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [general][io][bzip2] BZip2, Tar and Zip libraries

2003-11-23 Thread Jeremias Maerki
(Comments below)

On 23.11.2003 09:26:02 Henri Yandell wrote:
 
 Commons-IO contains a tar package and a zip package under a compress
 package.
 
 Both came from Avalon's Excalibur, but originally from Ant, as far as
 life in Apache goes. The tar package is originally Tim Endres' public
 domain package.
 
 Both are available at:
 
 http://cvs.apache.org/viewcvs/ant/src/main/org/apache/tools/
 
 I would like to remove these from Commons-IO, as they don't really fit
 there. I also wonder if the Commons-BZip2 component is worth keeping there
 or if it should be removed.
 
 Does anyone mind?

No. They don't belong in IO. bzip2 is also a duplicate of Ant's bzip2
although I guess there will be differences but Ant's code will certainly
be more advanced.

 Does anyone have a better idea as to where they could live? Ant-tools
 seems most likely to be the definitive location for bzip2, tar and zip.

I'd like to see a compression package in either Jakarta Commons or
Apache Commons. IMHO Ant is not the right place for that code because
that way it won't be found. I guess we need to talk to the Ant guys
about that.

Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [io] remove old ant build system

2003-11-23 Thread Jeremias Maerki
Nope, I guess not.

On 23.11.2003 10:34:38 Henri Yandell wrote:
 
 As the site is using maven, is there any need to keep the old build
 system? [build.properties, build.properties.sample, build.xml]
 
 It'll only get out of date if maven is the main build system [and vice
 versa].

Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [io] remove old ant build system

2003-11-23 Thread Stephen Colebourne
Doesn't gump use ant?
Stephen

- Original Message - 
From: Jeremias Maerki [EMAIL PROTECTED]
 Nope, I guess not.
 
 On 23.11.2003 10:34:38 Henri Yandell wrote:
  
  As the site is using maven, is there any need to keep the old build
  system? [build.properties, build.properties.sample, build.xml]
  
  It'll only get out of date if maven is the main build system [and vice
  versa].
 
 Jeremias Maerki
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [io] remove old ant build system

2003-11-23 Thread Jeremias Maerki
Right. How are other commons projects handling that? Maven claims to
integrate with Gump but still, I see quite a few projects still having a
build.xml and some having a (generated) build-gump.xml. Any
recommendations?

On 23.11.2003 11:36:37 Stephen Colebourne wrote:
 Doesn't gump use ant?
 Stephen
 
 - Original Message - 
 From: Jeremias Maerki [EMAIL PROTECTED]
  Nope, I guess not.
  
  On 23.11.2003 10:34:38 Henri Yandell wrote:
   
   As the site is using maven, is there any need to keep the old build
   system? [build.properties, build.properties.sample, build.xml]
   
   It'll only get out of date if maven is the main build system [and vice
   versa].

Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [io] remove old ant build system

2003-11-23 Thread David Graham

--- Stephen Colebourne [EMAIL PROTECTED] wrote:
 AFAIN, projects keep both in sync manually - not ideal.

No, you can have Maven generate an Ant build.xml file for you.  I believe
all you have to do is say maven ant and check in the generated file.

David

 
 Stephen
 
 - Original Message -
 From: Jeremias Maerki [EMAIL PROTECTED]
 To: Jakarta Commons Developers List [EMAIL PROTECTED]
 Sent: Sunday, November 23, 2003 10:54 AM
 Subject: Re: [io] remove old ant build system
 
 
  Right. How are other commons projects handling that? Maven claims to
  integrate with Gump but still, I see quite a few projects still having
 a
  build.xml and some having a (generated) build-gump.xml. Any
  recommendations?
 
  On 23.11.2003 11:36:37 Stephen Colebourne wrote:
   Doesn't gump use ant?
   Stephen
  
   - Original Message -
   From: Jeremias Maerki [EMAIL PROTECTED]
Nope, I guess not.
   
On 23.11.2003 10:34:38 Henri Yandell wrote:

 As the site is using maven, is there any need to keep the old
 build
 system? [build.properties, build.properties.sample,
 build.xml]

 It'll only get out of date if maven is the main build system
 [and
 vice
 versa].
 
  Jeremias Maerki
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [VOTE][RESULT] Release Commons Codec 1.2-rc1

2003-11-23 Thread Gary Gregory
I just found a bunch of Javadoc nits. I think I should hold off fixing those
since you (Tim) are in the middle of the RC1 to release process but I
thought I'd bring this up now as an FYI. 

It seems that [codec] is alive and well with new development in the works
(streamable stuff); so these fixes will see the light of day at some point.

Gary

 -Original Message-
 From: Tim O'Brien [mailto:[EMAIL PROTECTED]
 Sent: Thursday, November 20, 2003 20:07
 To: Jakarta Commons Developers List
 Subject: Re: [VOTE][RESULT] Release Commons Codec 1.2-rc1
 
 Alright Gary, thanks for pulling most of the load for this lately.  I'll
 do a release on Saturday.  (Why on Saturday?  IIRC, it takes some time
 to make sure all of the procedures are followed correctly.)
 
 Tim
 
 Gary Gregory wrote:
 
 The vote to release Commons Codec 1.2-rc1 has passed.  Here's a vote
 summary
 (Voting status based on codec/project.xml/developers):
 
 Binding +1:
  Henri Yandell
  Gary Gregory
  Tim O'Brien
 
 Non-binding +1:
  Michael Becke
  Matthew Hawthorne
  Oleg Kalnichevski
 
 Non-binding +0:
  John Keyes
 
 The [VOTE] thread can be found here:
 http://www.mail-archive.com/[EMAIL PROTECTED]/msg30302.html
 
 The files are currently tagged as CODEC_1_2_RC1.
 
 Based on previous communications with Tim on this list, I believe he
 mentioned picking it up from here but I am also available; there is a bit
 of
 grunt work to do if all there is to do is changing 1.2-rc1s to 1.2s.
 
 Thanks,
 Gary
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


re: new functionality in some of the commons classes - contd

2003-11-23 Thread Henri Yandell

One thing that helps is to use the [component] notation so that people
notice the email quicker. I imagine that most of us filter the components
that we care about most into special folders and check the general commons
folder less often. So a title like:

[lang] new functions for StringUtils

might help to get to those interested quickly. Create an email per
component. So if all the new ideas are for lang, one email, but if there
are collections or digester ideas etc, multiple emails. Don't worry about
sending an example, just go ahead and dump all the ideas to the list :)

If you feel the idea is getting ignored, reporting it as an improvement in
Bugzilla is often a good way to ensure it gets noticed before the next
release of the component.

Hope that helps,

Hen

On Sun, 23 Nov 2003, Ash .. wrote:

 Hi,

 I got no reply for my second email. (Or did I miss any.)
 Much of the ideas I have here are about minor functionality in some of the
 basic classes (such as lang.StringUtils etc). I would be glad to know how to
 go about it. I mentioned one as an example, perhaps it would be preferred if
 I mention all of them at one go? Since I am new to this group, I am not very
 familiar with your preferred way. Curious to know.
 Cheers,
 Ash





 Hello again,

 Adding to my earlier email I just sent out, I wish to give an example here,
 of some of the ideas I have.

 The concept of a naught String.

 A String is naught if it is either 'null' or is the literal null.

 I have often encountered this situation in my JSP project where a particular
 parameter is passed in
 as x=null, and I need to insert code everytime saying if(x == null ||
 x.equals(null))

 Perhaps others have encountered a similar situation. I thus propose the
 following functionality in the
 org.apache.commons.lang.StringUtils class:

 StringUtils.isNaught(String str)


 And more such to go. Waiting for some feedback.
 Thanks,
 Ash


 -Original Message-
 From: ASHWIN Suresh
 Sent: Saturday, November 22, 2003 20:47
 To: 'Jakarta Commons Developers List'
 Subject: new functionality in some of the commons classes


 Hello all,

 I am new to the list, and am here after my recent (and really exciting)
 discovery of the existence of this whole treasure of day-to-day usage
 code in the name of the Commons project.

 I would like to propose/contribute some new functionality to some
 of the classes (mostly simple stuff). Do let me know the procedure
 for this. If there is a standard document which explains this,
 which I missed, please give me a pointer to it.

 Thanks,

 _
 Stay in touch with absent friends - get MSN Messenger
 http://www.msn.co.uk/messenger


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/io build.xml build.properties.sample

2003-11-23 Thread bayard
bayard  2003/11/23 11:34:05

  Modified:io   build.xml
  Removed: io   build.properties.sample
  Log:
  Moved from old Ant style build to Maven build. Maven generated build.xml file there 
for Gump, so need to remember to keep it synced every now and then.
  
  Revision  ChangesPath
  1.13  +158 -262  jakarta-commons-sandbox/io/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-commons-sandbox/io/build.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- build.xml 21 Aug 2003 18:59:26 -  1.12
  +++ build.xml 23 Nov 2003 19:34:05 -  1.13
  @@ -1,275 +1,171 @@
  -project name=IO default=compile basedir=.
  +?xml version=1.0 encoding=UTF-8?
   
  +!--build.xml generated by maven from project.xml version SNAPSHOT
  +  on date November 23 2003, time 1432--
   
  -!--
  -IO component of the Jakarta Commons Subproject
  -$Id$
  ---
  -
  -
  -!-- == Initialize Properties = --
  -
  -
  -  property file=build.properties/!-- Component local   --
  -  property file=../build.properties/ !-- Commons local --
  -  property file=${user.home}/build.properties/   !-- User local--
  -
  -
  -!-- == External Dependencies = --
  -
  -
  -  !-- The directory containing your binary distribution of JUnit,
  -   version 3.7 or later --
  -  property name=junit.home  value=/usr/local/junit3.7/
  -
  -
  -!-- == Derived Values  --
  -
  -
  -  !-- The pathname of the junit.jar JAR file --
  -  property name=junit.jar   value=${junit.home}/junit.jar/
  -
  -
  -!-- == Component Declarations  --
  -
  -
  -  !-- The name of this component --
  -  property name=component.name  value=io/
  -
  -  !-- The primary package name of this component --
  -  property name=component.package   value=org.apache.commons.io/
  -
  -  !-- The title of this component --
  -  property name=component.title value=I/O Utilities/
  -
  -  !-- The current version number of this component --
  -  property name=component.version   value=1.0-dev/
  -
  -  !-- The base directory for compilation targets --
  -  property name=build.home  value=target/
  -
  -  !-- The base directory for component configuration files --
  -  property name=conf.home   value=src/conf/
  -
  -  !-- The base directory for distribution targets --
  -  property name=dist.home   value=dist/
  -
  -  !-- The base directory for component sources --
  -  property name=source.home value=src/java/
  -
  -  !-- The base directory for unit test sources --
  -  property name=test.home   value=src/test/
  -
  -  !-- Test data directory --
  -  property name=data.test   value=data/test/
  -
  -!-- == Compiler Defaults = --
  -
  -
  -  !-- Should Java compilations set the 'debug' compiler option? --
  -  property name=compile.debug   value=true/
  -
  -  !-- Should Java compilations set the 'deprecation' compiler option? --
  -  property name=compile.deprecation value=true/
  -
  -  !-- Should Java compilations set the 'optimize' compiler option? --
  -  property name=compile.optimizevalue=true/
  -
  -  !-- Construct compile classpath --
  -  path id=compile.classpath
  -pathelement location=${build.home}/classes/
  -  /path
  -
  -
  -!-- == Test Execution Defaults === --
  -
  -
  -  !-- Construct unit test classpath --
  -  path id=test.classpath
  -pathelement location=${build.home}/classes/
  -pathelement location=${build.home}/tests/
  -pathelement location=${junit.jar}/
  -  /path
  -
  -  !-- Should all tests fail if one does? --
  -  property name=test.failonerrorvalue=false/
  -
  -  !-- The test runner to execute --
  -  property name=test.runner value=junit.textui.TestRunner/
  -
  -
  -!-- == Executable Targets  --
  -
  -
  -  target name=init
  -   description=Initialize and evaluate conditionals
  -echo message= ${component.name} ${component.version} /
  -filter  token=name  value=${component.name}/
  -filter  token=package   value=${component.package}/
  -filter  token=version   value=${component.version}/
  -  /target
  -
  -
  -  target name=prepare depends=init
  -   description=Prepare build directory
  -mkdir dir=${build.home}/
  -mkdir dir=${build.home}/classes/
  -mkdir dir=${build.home}/conf/
  -mkdir dir=${build.home}/tests/
  -  /target
  -
  -
  -  target name=static 

Re: [io] remove old ant build system

2003-11-23 Thread Henri Yandell

Yep.

I've gone ahead and done this. We'll see if gump and maven play nice and
work correctly or not.

Hen

On Sun, 23 Nov 2003, David Graham wrote:


 --- Stephen Colebourne [EMAIL PROTECTED] wrote:
  AFAIN, projects keep both in sync manually - not ideal.

 No, you can have Maven generate an Ant build.xml file for you.  I believe
 all you have to do is say maven ant and check in the generated file.

 David

 
  Stephen
 
  - Original Message -
  From: Jeremias Maerki [EMAIL PROTECTED]
  To: Jakarta Commons Developers List [EMAIL PROTECTED]
  Sent: Sunday, November 23, 2003 10:54 AM
  Subject: Re: [io] remove old ant build system
 
 
   Right. How are other commons projects handling that? Maven claims to
   integrate with Gump but still, I see quite a few projects still having
  a
   build.xml and some having a (generated) build-gump.xml. Any
   recommendations?
  
   On 23.11.2003 11:36:37 Stephen Colebourne wrote:
Doesn't gump use ant?
Stephen
   
- Original Message -
From: Jeremias Maerki [EMAIL PROTECTED]
 Nope, I guess not.

 On 23.11.2003 10:34:38 Henri Yandell wrote:
 
  As the site is using maven, is there any need to keep the old
  build
  system? [build.properties, build.properties.sample,
  build.xml]
 
  It'll only get out of date if maven is the main build system
  [and
  vice
  versa].
  
   Jeremias Maerki
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 


 __
 Do you Yahoo!?
 Free Pop-Up Blocker - Get it now
 http://companion.yahoo.com/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Fwd: [math] Contribution to math.linear - CholeskySolver

2003-11-23 Thread Mark R. Diggory
I would like to forward this to the list so that others can look at it 
and comment as well. Please do try to use the Developers List as I am 
not always available, others may have more experience with a particular 
class or implementation in the package.

I will do an initial commit of the code into experimental, and once the 
code has been deemed acceptable by the group, we can migrate the solver 
into src/java and the Test into src/test.

Cheers,
-Mark
Hello Mark, 

to extend the jakarta-math.linear-package I've 
implemented the Cholesky-algorithm. 

The attached Zip-file contains
* CholeskySolver.java (the algorithm)
* CholeskySolverTest.java (JUnit-TestCase)
* BugfixAndSuggestions.txt (to impove RealMatrixImpl.java)
If you okay this contribution, I will volunteer for
Householder decomposition (QR), Gauss-Seidel iteration and
Jacobi iteration. Since this will become some work, I would 
like to see a positive reaction first.

I think we will find theres lots of room to move forward with 
implementing these algorithms. I would suggest to continue with your 
approach. Much of my own interest is currently in architecture and 
reusability, so we could always use a hand in algorithm development. If 
we do make any architectural decisions, it may effect what you've 
submitted through refactoring.

Frankfurt a. M., 23.11.2003
Stefan Koeberle
[EMAIL PROTECTED]
I'm going to include the recommendation to RealMatrix in this email so 
we can get comments from the group.

1. RealMatrixImpl.multiply
Method RealMatrixImpl.multiply is broken. It can't multiply a Matrix of 
dimension n*k with a matrix of dimension k*m for knm. 
I append a correct implementation of this method and an additional test for 
RealMatrixImplTest.multiply somewhere below.

Sensible. I will apply this to RealMatrix and test it.

2. RealMatrixImpl.getData
Method RealMatrixImpl.getData returns a copy of the stored data. Every call 
of this method will require the allocation of a new double[][]-object and the
corresponding copy-operation. Since it is called in RealMatrixImpl.add,
RealMatrixImpl.subtract, ... this behaviour will wreck performance. It's 
completely unnecessary, too.
Suggestion: RealMatrixImpl.getData should return a reference to the stored 
array. Method RealMatrixImpl.getDataRef is unnecessary and should be removed.

I suspect this is an area where discussions concerning encapsulation and 
exposure of internal datastructures can get heated. Yes, unnecessary 
copying should be avoided when performing Matrix operations.

Traditionally, we should possibly consider the usage of methods like 
Object[] toArray() of the collections API as a model. Does this 
publically exposed method always create a copy of the Collections 
internal datastructure? Yes, infact it does:

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collection.html#toArray()

But, well documented behaviors should be made because an Object[] simply 
holds references to the same Objects that are referenced in the 
Collection, and not a new copy of that object. If the same concept is 
applied to

public double[][] toDoubleArray()

and it actually returns a copy, changing a value at 
foo.toDoubleArray()[x][y] doesn't change the double stored in the 
internal double[][] as well. The primitive case can't be made 
behaviorally equivalent to the Collection case.

I think we should maintain methods that return a copy and methods that 
return a reference, I would recommend that methods that return a 
reference be protected and used internally for processing methods like 
RealMatrixImpl.subtract. your correct about the copying, simply 
replacing all the getData() methods with getDataRef() methods solves 
this however.

public RealMatrix subtract(RealMatrix m) throws 
IllegalArgumentException {
   ...
*double[][] mData = m.getDataRef();*
for (int row = 0; row  rowCount; row++) {
for (int col = 0; col  columnCount; col++) {
outData[row][col] = data[row][col] - mData[row][col];
}
}
return new RealMatrixImpl(outData);
}



3. RealMatrixImpl.getIdentity
Method RealMatrixImpl.getIdentity doesn't GET an internal value of RealMatrixImpl.
It creates a new matrix and should be named createIdentity or newIdentity.
The code can be simplified. A new implementation is appended below.
Yes, descriptive method names should be appropriate.


4. RealMatrixImpl.toString
For debugging and testing there should be an easy way to print the elements 
of the matrix. I suggest to use the toString method. 
For a possible implementation just scroll down.

good.


public static RealMatrix newIdentity(int dimension) {
double[][] val = new double[dimension][dimension]; 
 //here: All elements of val are zero. That is guaranteed by the
 //Java language specification.
for (int i=0; ival.length; i++) 
val[i][i] = 1.0d;
return new RealMatrixImpl(val);

cvs commit: jakarta-commons/math/src/experimental/org/apache/commons/math/linear CholeskySolverTest.java CholeskySolver.java

2003-11-23 Thread mdiggory
mdiggory2003/11/23 11:53:40

  Added:   math/src/experimental/org/apache/commons/math/linear
CholeskySolverTest.java CholeskySolver.java
  Log:
  New additions of CholeskySolver contributed by Stefan Koeberle
  
  Revision  ChangesPath
  1.1  
jakarta-commons/math/src/experimental/org/apache/commons/math/linear/CholeskySolverTest.java
  
  Index: CholeskySolverTest.java
  ===
  /* 
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *any, must include the following acknowledgement:
   *   This product includes software developed by the
   *Apache Software Foundation (http://www.apache.org/).
   *Alternately, this acknowledgement may appear in the software itself,
   *if and wherever such third-party acknowledgements normally appear.
   *
   * 4. The names The Jakarta Project, Commons, and Apache Software
   *Foundation must not be used to endorse or promote products derived
   *from this software without prior written permission. For written
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called Apache
   *nor may Apache appear in their name without prior written
   *permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * 
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * http://www.apache.org/.
   */
  
  package org.apache.commons.math.linear;
  
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  import junit.textui.TestRunner;
  
  /**
   * Test cases for the [EMAIL PROTECTED] CholeskySolver} class.
   * p
   * @author Stefan Koeberle, 11/2003
   */
  public class CholeskySolverTest 
  extends TestCase {
  
  private double[][] m1 = {{1}};
  private double m1Det = 1.0d;
  
  private double[][] m2 = {{1, 0} , 
   {0, 2}};
  private double m2Det = 2.0d; 
  
  private double[][] m3 = {{1, 0, 0}, 
   {0, 2, 0}, 
   {0, 0, 3}};
  private double m3Det = 6.0d;
   
  private double[][] m4 = {{1, 0, 0}, 
   {2, 3, 0}, 
   {4, 5, 6}};
  private double m4Det = 18.0d;
  
  private double[][] m5 = {{ 1,  0,  0,  0,  0}, 
   {-2,  3,  0,  0,  0}, 
   { 4, -5,  6,  0,  0},
   { 7,  8, -9, 10,  0},
   {11, 12, 13, 14, 15}};
  private double m5Det = 2700.0d;
  
   
  private double[][] m6 = {{1, 0,  0}, 
   {2, 0,  0}, 
   {4, 5,  6}};
  
  private double[][] m7 = {{1, 2, 3}, 
   {4, 5, 6}};  

  /** 
   * Creates a new instance of 

cvs commit: jakarta-commons-sandbox/io/src/test/org/apache/commons/io/compress/zip AsiExtraFieldTestCase.java ExtraFieldUtilsTestCase.java ZipEntryTestCase.java ZipLongTestCase.java ZipShortTestCase.java

2003-11-23 Thread bayard
bayard  2003/11/23 11:59:52

  Modified:io   project.xml
  Removed: io/src/java/org/apache/commons/io/compress/tar
TarBuffer.java TarConstants.java TarEntry.java
TarInputStream.java TarOutputStream.java
TarUtils.java
   io/src/java/org/apache/commons/io/compress/zip
AsiExtraField.java ExtraFieldUtils.java
UnixStat.java UnrecognizedExtraField.java
ZipEntry.java ZipExtraField.java ZipLong.java
ZipOutputStream.java ZipShort.java
   io/src/test/org/apache/commons/io/compress/tar
TarTestCase.java TarTestSuite.java data.txt gnu.tar
posix.tar update-tars.bat
   io/src/test/org/apache/commons/io/compress/zip
AsiExtraFieldTestCase.java
ExtraFieldUtilsTestCase.java ZipEntryTestCase.java
ZipLongTestCase.java ZipShortTestCase.java
  Log:
  Removed the compress packages from IO. They will appear soon in a holding
  project in the sandbox named 'compress'.
  
  Revision  ChangesPath
  1.14  +0 -1  jakarta-commons-sandbox/io/project.xml
  
  Index: project.xml
  ===
  RCS file: /home/cvs/jakarta-commons-sandbox/io/project.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- project.xml   23 Nov 2003 13:13:28 -  1.13
  +++ project.xml   23 Nov 2003 19:59:52 -  1.14
  @@ -183,7 +183,6 @@
   /includes
   excludes
   exclude**/testtools/**/exclude
  -exclude**/compress/**/*Test*/exclude
   exclude**/IOUtilTestCase*/exclude
   /excludes
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [general][io][bzip2] BZip2, Tar and Zip libraries

2003-11-23 Thread Henri Yandell


On Sun, 23 Nov 2003, Jeremias Maerki wrote:

 I'd like to see a compression package in either Jakarta Commons or
 Apache Commons. IMHO Ant is not the right place for that code because
 that way it won't be found. I guess we need to talk to the Ant guys
 about that.

Pulled them out of IO.

Tests don't pass currently for tar, will push them back in as a 'compress'
component, though some had complained about the name as tar doesn't
compress.

At least this stops them hiding away inside IO and might get them a bit
more notice.

Hen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:04:20

  jakarta-commons-sandbox/compress - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:14

  jakarta-commons-sandbox/compress/src - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src/java/org - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:14

  jakarta-commons-sandbox/compress/src/java/org - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src/java - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:14

  jakarta-commons-sandbox/compress/src/java - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src/java/org/apache/commons/compress/zip - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:15

  jakarta-commons-sandbox/compress/src/java/org/apache/commons/compress/zip - New 
directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src/test/org/apache - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:15

  jakarta-commons-sandbox/compress/src/test/org/apache - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src/test - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:14

  jakarta-commons-sandbox/compress/src/test - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src/java/org/apache/commons/compress/tar - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:15

  jakarta-commons-sandbox/compress/src/java/org/apache/commons/compress/tar - New 
directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src/test/org/apache/commons - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:15

  jakarta-commons-sandbox/compress/src/test/org/apache/commons - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src/test/org/apache/commons/compress/zip - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:15

  jakarta-commons-sandbox/compress/src/test/org/apache/commons/compress/zip - New 
directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src/java/org/apache - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:14

  jakarta-commons-sandbox/compress/src/java/org/apache - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src/java/org/apache/commons - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:15

  jakarta-commons-sandbox/compress/src/java/org/apache/commons - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src/test/org - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:14

  jakarta-commons-sandbox/compress/src/test/org - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src/test/org/apache/commons/compress - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:15

  jakarta-commons-sandbox/compress/src/test/org/apache/commons/compress - New directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress/src/test/org/apache/commons/compress/tar - New directory

2003-11-23 Thread bayard
bayard  2003/11/23 12:05:15

  jakarta-commons-sandbox/compress/src/test/org/apache/commons/compress/tar - New 
directory

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/io/xdocs tasks.xml

2003-11-23 Thread bayard
bayard  2003/11/23 12:08:33

  Modified:io/xdocs tasks.xml
  Log:
  compress code moved out
  
  Revision  ChangesPath
  1.3   +0 -1  jakarta-commons-sandbox/io/xdocs/tasks.xml
  
  Index: tasks.xml
  ===
  RCS file: /home/cvs/jakarta-commons-sandbox/io/xdocs/tasks.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- tasks.xml 23 Nov 2003 13:13:28 -  1.2
  +++ tasks.xml 23 Nov 2003 20:08:33 -  1.3
  @@ -7,7 +7,6 @@
   release of this component:
 /p
 ul
  -liCompress - Move the compress sub-package out of IO - READY/li
   liIOUtils: Remove the toByteArray() variants with the bufferSize
   parameter. Reasoning can be found at
   http://www.mail-archive.com/[EMAIL PROTECTED]/msg19703.html/li
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons-sandbox/compress README.txt

2003-11-23 Thread bayard
bayard  2003/11/23 12:11:06

  Added:   compress README.txt
  Log:
  note that this is not an active piece of code
  
  Revision  ChangesPath
  1.1  jakarta-commons-sandbox/compress/README.txt
  
  Index: README.txt
  ===
  Currently there is no proposal as this code has been passed around from 
  place to place and is not supported by anyone in Commons. As best I can 
  tell the migration has been:
  
  Ant - Avalon-Excalibur - Commons-IO - Commons-Compress.
  
  BZip2 has had a similar path.
  
  -
  [EMAIL PROTECTED]
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Fwd: [math] Contribution to math.linear - CholeskySolver

2003-11-23 Thread Mark R. Diggory
To be a little clearer, I think that RealMatrix shouldn't neccessarily 
be an Interface, it may be more logical to use an Abstract Class as the 
basis for this. Then a RealMatrix could have both public, protected, and 
private methods well defined and usable in its implementations.

public abstract class RealMatrix{

public static newInstance(double[][] values){
 /* instantiates a RealMatrix of a
  * generic underlying implementation
  */
}
/* nice generic implementation of subtraction
 * that could be overiden in the implementing
 * class. Promotes polymorphism.
 */
public RealMatrix subtract(RealMatrix m){
/*...*/
int rowCount = this.getRowDimension();
int columnCount = this.getColumnDimension();
double[][] outData = new double[rowCount][columnCount];
*double[][] mData = m.getDataRef();*
for (int row = 0; row  rowCount; row++) {
for (int col = 0; col  columnCount; col++) {
outData[row][col] = data[row][col] - mData[row][col];
}
}
*return RealMatrix.newInstance(outData);*
}
   ...

   protected abstract double[][] getDataRef();

   protected abstract double[][] getData();

   ...
}
I think this is really much more usefull in the long run and can be more 
easily adapted to different underlying implementations in the future. 
The important features are the abstract implementation of the protected 
and public getData/Ref methods plus the Factory style 
RealMatrix.newInstance(outData) method.

-Mark

Mark R. Diggory wrote:

I would like to forward this to the list so that others can look at it 
and comment as well. Please do try to use the Developers List as I am 
not always available, others may have more experience with a particular 
class or implementation in the package.

I will do an initial commit of the code into experimental, and once the 
code has been deemed acceptable by the group, we can migrate the solver 
into src/java and the Test into src/test.

Cheers,
-Mark
Hello Mark,
to extend the jakarta-math.linear-package I've implemented the 
Cholesky-algorithm.
The attached Zip-file contains
* CholeskySolver.java (the algorithm)
* CholeskySolverTest.java (JUnit-TestCase)
* BugfixAndSuggestions.txt (to impove RealMatrixImpl.java)

If you okay this contribution, I will volunteer for
Householder decomposition (QR), Gauss-Seidel iteration and
Jacobi iteration. Since this will become some work, I would like to 
see a positive reaction first.

I think we will find theres lots of room to move forward with 
implementing these algorithms. I would suggest to continue with your 
approach. Much of my own interest is currently in architecture and 
reusability, so we could always use a hand in algorithm development. If 
we do make any architectural decisions, it may effect what you've 
submitted through refactoring.

Frankfurt a. M., 23.11.2003
Stefan Koeberle
[EMAIL PROTECTED]


I'm going to include the recommendation to RealMatrix in this email so 
we can get comments from the group.

1. RealMatrixImpl.multiply
Method RealMatrixImpl.multiply is broken. It can't multiply a Matrix 
of dimension n*k with a matrix of dimension k*m for knm. I append 
a correct implementation of this method and an additional test for 
RealMatrixImplTest.multiply somewhere below.

Sensible. I will apply this to RealMatrix and test it.

2. RealMatrixImpl.getData
Method RealMatrixImpl.getData returns a copy of the stored data. Every 
call of this method will require the allocation of a new 
double[][]-object and the
corresponding copy-operation. Since it is called in RealMatrixImpl.add,
RealMatrixImpl.subtract, ... this behaviour will wreck performance. 
It's completely unnecessary, too.
Suggestion: RealMatrixImpl.getData should return a reference to the 
stored array. Method RealMatrixImpl.getDataRef is unnecessary and 
should be removed.

I suspect this is an area where discussions concerning encapsulation and 
exposure of internal datastructures can get heated. Yes, unnecessary 
copying should be avoided when performing Matrix operations.

Traditionally, we should possibly consider the usage of methods like 
Object[] toArray() of the collections API as a model. Does this 
publically exposed method always create a copy of the Collections 
internal datastructure? Yes, infact it does:

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collection.html#toArray()

But, well documented behaviors should be made because an Object[] simply 
holds references to the same Objects that are referenced in the 
Collection, and not a new copy of that object. If the same concept is 
applied to

public double[][] toDoubleArray()

and it actually returns a copy, changing a value at 
foo.toDoubleArray()[x][y] doesn't change the double stored in the 
internal double[][] as well. The primitive case can't be made 
behaviorally equivalent to the Collection case.

I think we should maintain methods that 

cvs commit: jakarta-commons-sandbox/io RELEASE-NOTES.txt

2003-11-23 Thread bayard
bayard  2003/11/23 12:12:21

  Modified:io   RELEASE-NOTES.txt
  Log:
  removed note about Lang dependency
  
  Revision  ChangesPath
  1.3   +1 -4  jakarta-commons-sandbox/io/RELEASE-NOTES.txt
  
  Index: RELEASE-NOTES.txt
  ===
  RCS file: /home/cvs/jakarta-commons-sandbox/io/RELEASE-NOTES.txt,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RELEASE-NOTES.txt 7 Dec 2002 20:34:18 -   1.2
  +++ RELEASE-NOTES.txt 23 Nov 2003 20:12:20 -  1.3
  @@ -12,9 +12,6 @@
   current release adds new features and bug fixes, and is being done now to
   follow the release early/release often mentality.
   
  -The current pre-release is dependent on the Commons Lang CVS HEAD, or version 
  -1.1 if that has been released.
  -
   NEW FEATURES:
   
   * 
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons/math/src/java/org/apache/commons/math/linear RealMatrixImpl.java

2003-11-23 Thread mdiggory
mdiggory2003/11/23 12:16:17

  Modified:math/src/java/org/apache/commons/math/linear
RealMatrixImpl.java
  Log:
  Patch to correct error in matrix multiply 
  and the addition od toString method.
  
  Revision  ChangesPath
  1.9   +26 -6 
jakarta-commons/math/src/java/org/apache/commons/math/linear/RealMatrixImpl.java
  
  Index: RealMatrixImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/linear/RealMatrixImpl.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- RealMatrixImpl.java   14 Nov 2003 22:22:19 -  1.8
  +++ RealMatrixImpl.java   23 Nov 2003 20:16:17 -  1.9
  @@ -249,7 +249,7 @@
   }
   return new RealMatrixImpl(outData);
   }
  -
  +
   /**
* Returns the result postmultiplying this by codem/code.
* @param mmatrix to postmultiply by
  @@ -263,15 +263,15 @@
   (Matrices are not multiplication compatible.);
   }
   int nRows = this.getRowDimension();
  -int nCols = this.getColumnDimension();
  +int nCols = m.getColumnDimension();
  +int nSum = this.getColumnDimension();
   double[][] mData = m.getData();
  -double[][] outData =
  -new double[nRows][nCols];
  +double[][] outData = new double[nRows][nCols];
   double sum = 0;
   for (int row = 0; row  nRows; row++) {
   for (int col = 0; col  nCols; col++) {
   sum = 0;
  -for (int i = 0; i  nCols; i++) {
  +for (int i = 0; i  nSum; i++) {
   sum += data[row][i] * mData[i][col];
   }
   outData[row][col] = sum;
  @@ -719,6 +719,26 @@
   }
   }
   }
  +
  +/**
  + * 
  + * @see java.lang.Object#toString()
  + */
  +public String toString() {
  +StringBuffer res = new StringBuffer();
  +res.append(RealMatrixImpl{);
  +for (int i=0; idata.length; i++)  {
  +if (i0) res.append(,);
  +res.append({);
  +for (int j=0; jdata[0].length; j++) {
  +if (j0) res.append(,);
  +res.append(data[i][j]);
  +}//for
  +res.append(});
  +}//for
  +res.append(});
  +return res.toString();
  +}//toString
   
   // Protected methods
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [io] Current plan?

2003-11-23 Thread Henri Yandell

I'm unsure what the view is on this. STATUS.html has until maven been an
official Commons file. Possibly we need to rename tasks.xml to STATUS.xml
and make sure every part of the STATUS.html moves down into it.

Hen

On Sun, 23 Nov 2003, Jeremias Maerki wrote:

 Hmm, forget that. There seems to be a tasks.xml file in xdocs. I will
 remove that part in status.html.

 On 23.11.2003 10:45:06 Jeremias Maerki wrote:
  We've got some kind of todo list in the status.html.

 Jeremias Maerki


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [io] Current plan?

2003-11-23 Thread Henri Yandell


On Sun, 23 Nov 2003, Jeremias Maerki wrote:

 there was to say. Now it's already better and one of the next steps is
 to create a FilenameUtils class with methods for people who work with
 filenames instead of java.io.File. FileUtils is reserved for
 java.io.File.

Okay. I can get to work on this.

The deprecated methods should be removed or goto FilenameUtils?

Hen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons/math/src/test/org/apache/commons/math/linear RealMatrixImplTest.java

2003-11-23 Thread mdiggory
mdiggory2003/11/23 12:34:41

  Modified:math/src/test/org/apache/commons/math/linear
RealMatrixImplTest.java
  Log:
  Additional Matrix Multiply test
  
  Revision  ChangesPath
  1.8   +15 -2 
jakarta-commons/math/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java
  
  Index: RealMatrixImplTest.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RealMatrixImplTest.java   14 Nov 2003 22:22:19 -  1.7
  +++ RealMatrixImplTest.java   23 Nov 2003 20:34:41 -  1.8
  @@ -182,7 +182,7 @@
   ;
   }  
   }
  -
  +   
   /** test multiply */
public void testMultiply() {
   RealMatrixImpl m = new RealMatrixImpl(testData);
  @@ -206,6 +206,19 @@
   ;
   }  
   }   
  +
  +//Additional Test for RealMatrixImplTest.testMultiply
  +
  +private double[][] d3 = new double[][] {{1,2,3,4},{5,6,7,8}};
  +private double[][] d4 = new double[][] {{1},{2},{3},{4}};
  +private double[][] d5 = new double[][] {{30},{70}};
  + 
  +public void testMultiply2() { 
  +   RealMatrix m3 = new RealMatrixImpl(d3);   
  +   RealMatrix m4 = new RealMatrixImpl(d4);
  +   RealMatrix m5 = new RealMatrixImpl(d5);
  +   assertClose(m3*m4=m5, m3.multiply(m4), m5, entryTolerance);
  +   }  
   
   /** test isSingular */
   public void testIsSingular() {
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang StringUtilsTest.java

2003-11-23 Thread psteitz
psteitz 2003/11/23 12:44:39

  Modified:lang/src/java/org/apache/commons/lang StringUtils.java
   lang/src/test/org/apache/commons/lang StringUtilsTest.java
  Log:
  Fixed error in javadoc for StringUtils.split and improved tests.
  Pr: 24911
  Submitted by Al Chou.
  
  Revision  ChangesPath
  1.118 +9 -5  
jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java
  
  Index: StringUtils.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
  retrieving revision 1.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- StringUtils.java  4 Nov 2003 21:00:22 -   1.117
  +++ StringUtils.java  23 Nov 2003 20:44:39 -  1.118
  @@ -2087,22 +2087,26 @@
   }
   
   /**
  - * pSplits the provided text into an array, separators specified.
  - * This is an alternative to using StringTokenizer./p
  + * pSplits the provided text into an array with a maximum length, 
  + * separators specified./p
*
* pThe separator is not included in the returned String array.
* Adjacent separators are treated as one separator./p
*
* pA codenull/code input String returns codenull/code.
* A codenull/code separatorChars splits on whitespace./p
  - * 
  + *
  + * pIf more than codemax/code delimited substrings are found, the last 
  + * returned string includes all characters after the first codemax - 1/code
  + * returned strings (including separator characters)./p
  + *
* pre
* StringUtils.split(null, *, *)= null
* StringUtils.split(, *, *)  = []
* StringUtils.split(ab de fg, null, 0)   = [ab, cd, ef]
* StringUtils.split(ab   de fg, null, 0) = [ab, cd, ef]
* StringUtils.split(ab:cd:ef, :, 0)= [ab, cd, ef]
  - * StringUtils.split(ab:cd:ef, :, 2)= [ab, cdef]
  + * StringUtils.split(ab:cd:ef, :, 2)= [ab, cd:ef]
* /pre
* 
* @param str  the String to parse, may be null
  
  
  
  1.56  +20 -4 
jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsTest.java
  
  Index: StringUtilsTest.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsTest.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- StringUtilsTest.java  1 Nov 2003 19:20:35 -   1.55
  +++ StringUtilsTest.java  23 Nov 2003 20:44:39 -  1.56
  @@ -75,6 +75,7 @@
* @author a href=[EMAIL PROTECTED]Henning P. Schmiedehausen/a
* @author Phil Steitz
* @author a href=mailto:[EMAIL PROTECTED]Gary Gregory/a
  + * @author Al Chou
* @version $Id$
*/
   public class StringUtilsTest extends TestCase {
  @@ -280,14 +281,14 @@
   public void testSplit_String() {
   assertEquals(null, StringUtils.split(null));
   assertEquals(0, StringUtils.split().length);
  -
  +
   String str = a b  .c;
   String[] res = StringUtils.split(str);
   assertEquals(3, res.length);
   assertEquals(a, res[0]);
   assertEquals(b, res[1]);
   assertEquals(.c, res[2]);
  -
  +
   str =  a ;
   res = StringUtils.split(str);
   assertEquals(1, res.length);
  @@ -297,7 +298,7 @@
   res = StringUtils.split(str);
   assertEquals(2, res.length);
   assertEquals(a, res[0]);
  -assertEquals(b + NON_WHITESPACE + c, res[1]);
  +assertEquals(b + NON_WHITESPACE + c, res[1]);   
   }
   
   public void testSplit_StringChar() {
  @@ -339,6 +340,21 @@
   innerTestSplit(WHITESPACE.charAt(i), null, 
NON_WHITESPACE.charAt(j));
   innerTestSplit(WHITESPACE.charAt(i), 
String.valueOf(WHITESPACE.charAt(i)), NON_WHITESPACE.charAt(j));
   }
  +}
  +
  +String[] results = null;
  +String[] expectedResults = {ab, de fg};
  +results = StringUtils.split(ab   de fg, null, 2);
  +assertEquals(expectedResults.length, results.length);
  +for (int i = 0; i  expectedResults.length; i++) {
  +assertEquals(expectedResults[i], results[i]);
  +}
  +
  +String[] expectedResults2 = {ab, cd:ef};
  +results = StringUtils.split(ab:cd:ef,:, 2);
  +assertEquals(expectedResults2.length, results.length);
  +for (int i = 0; i  expectedResults2.length; i++) {
  +assertEquals(expectedResults2[i], results[i]);
   }
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[lang] new functionality in StringUtils and ArrayUtils - proposal 01

2003-11-23 Thread Ash ..
Hi,

I would like to propose the following methods to the StringUtils and 
ArrayUtils classes.
They are just minor additions to the existing functionality, but I thought 
would be interesting,
hopefully quite useful too.

Waiting for feedback and looking forward to some development in this regard.
I would be glad to submit an implementation to the concerned people, if you 
feel this functionality
is include-worthy.

Thanks,
Ash




 /**
 * Flanks the given string with the flank String or char.
 * pre
 * StringUtils.flank(null, *)  = null
 * StringUtils.flank(, *)= *
 * StringUtils.flank(abc, null)  = abc
 * StringUtils.flank(abc, x)  = xabcx
 * StringUtils.flank(abc, xy)  = xyabcxy  // xy...xy
 * /pre
 */
 StringUtils.flank(String flankee, String flank)
 StringUtils.flank(String flankee, char flank)
Some special cases of flanking are quotes.

 /**
  * pre
  * StringUtils.singleQuote(Now is the time...) = 'Now is the time...'
  * /pre
  */
 StringUtils.singleQuote(String quotee)
 /**
  * pre
  * StringUtils.doubleQuote(Now is the time...) = Now is the time...
  * /pre
  */
 StringUtils.doubleQuote(String quotee)


 /**
  * Enclose the string with a pair of symmetrical characters
  * given one of the pair. Such pairs are
  *
  * tt
  * (), {}, [], lt;gt;,
  * /tt
  *
  * When the encloser is not from a recognized pair,
  * the method resorts to flank-like appending, with the order
  * for the afterpart reversed.
  *
  * pre
  * StringUtils.enclose(abc, [)= [abc]
  * StringUtils.enclose(abc, [[)   = [[abc]]
  * StringUtils.enclose(abc, x)= xabcx
  * StringUtils.enclose(abc, xy)   = xyabcyx  // xy..yx
  * /pre
  *
  * @param enclosee the String to be enclosed
  * @param either of such pairs of strings as given above
  */
 StringUtils.enclose(String enclosee, String encloser)


 /**
  * pre
  * StringUtils.lead(abc, zz)  = zzabc
  * /pre
  */
 StringUtils.lead(String leadee, String leadStr)
 StringUtils.lead(String leadee, String leadChar)
 /**
  * pre
  * StringUtils.lead(abc, '.', 3)  = abc...
  */
 StringUtils.lead(String leadee, char leadStr,   int repeatCount)
 StringUtils.lead(String leadee, String leadStr, int repeatCount)
 /**
  * pre
  * StringUtils.trail(abc, zz)  = abczz
  * /pre
  */
 StringUtils.trail(String trailee, String trailStr)
 StringUtils.trail(String trailee, char trailChar)
 StringUtils.trail(String trailee, String trailStr, int repeatCount)
 StringUtils.trail(String trailee, char trailChar, int repeatCount)


 /**
  * The concept of naught.
  * True if the String is null or null.
  * pre
  * StringUtils.isNaught(abc) = false
  * StringUtils.isNaught(null)  = true
  * StringUtils.isNaught(null) = true
  * /pre
  */
 StringUtils.isNaught(String str)


 // ArrayUtils methods

 /**
  * Similar to the existing codetoString/code but
  * using delimiter given.
  */
 ArrayUtils.toString(Object array, String delimiter)
 ArrayUtils.toString(Object array, char delimiter)
 /**
  * A codetoString/code that emits only a given part
  * of the array.
  */
 ArrayUtils.toString(Object arr, int startIndex, int endIndex)


 /**
  * Obtain a new array of the given size, with the elements
  * present between startIndex (inclusive) and endIndex (exclusive).
  */
 ArrayUtils.subarray(arr, startIndex, endIndex)


---




The concept of a naught String.

A String is naught if it is either 'null' or is the literal null.

I have often encountered this situation in my JSP project where a 
particular
parameter is passed in
as x=null, and I need to insert code everytime saying if(x == null ||
x.equals(null))
_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


DO NOT REPLY [Bug 24911] - last substring returned by StringUtils.split( String, String, int ) is too long

2003-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24911.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24911

last substring returned by StringUtils.split( String, String, int ) is too long





--- Additional Comments From [EMAIL PROTECTED]  2003-11-23 20:46 ---
You are correct.  There was an error in the javadoc.  I have fixed the error and
added test cases to verify current behavior.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[io] xdocs/changes.xml

2003-11-23 Thread Henri Yandell

So what's the point of this file then?

It looks like a manual version of a CVS Changelog.

Hen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [lang] new functionality in StringUtils and ArrayUtils - proposal 01 - error

2003-11-23 Thread Ash ..
In my previous email,





 /**
  * pre
  * StringUtils.lead(abc, '.', 3)  = abc...
  */
This should be:

 /**
  * pre
  * StringUtils.trail(abc, '.', 3)  = abc...
  */





From: Ash .. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]


Hi,

I would like to propose the following methods to the StringUtils and 
ArrayUtils classes.
They are just minor additions to the existing functionality, but I thought 
would be interesting,
hopefully quite useful too.

Waiting for feedback and looking forward to some development in this 
regard.
I would be glad to submit an implementation to the concerned people, if you 
feel this functionality
is include-worthy.

Thanks,
Ash




 /**
 * Flanks the given string with the flank String or char.
 * pre
 * StringUtils.flank(null, *)  = null
 * StringUtils.flank(, *)= *
 * StringUtils.flank(abc, null)  = abc
 * StringUtils.flank(abc, x)  = xabcx
 * StringUtils.flank(abc, xy)  = xyabcxy  // xy...xy
 * /pre
 */
 StringUtils.flank(String flankee, String flank)
 StringUtils.flank(String flankee, char flank)
Some special cases of flanking are quotes.

 /**
  * pre
  * StringUtils.singleQuote(Now is the time...) = 'Now is the time...'
  * /pre
  */
 StringUtils.singleQuote(String quotee)
 /**
  * pre
  * StringUtils.doubleQuote(Now is the time...) = Now is the time...
  * /pre
  */
 StringUtils.doubleQuote(String quotee)


 /**
  * Enclose the string with a pair of symmetrical characters
  * given one of the pair. Such pairs are
  *
  * tt
  * (), {}, [], lt;gt;,
  * /tt
  *
  * When the encloser is not from a recognized pair,
  * the method resorts to flank-like appending, with the order
  * for the afterpart reversed.
  *
  * pre
  * StringUtils.enclose(abc, [)= [abc]
  * StringUtils.enclose(abc, [[)   = [[abc]]
  * StringUtils.enclose(abc, x)= xabcx
  * StringUtils.enclose(abc, xy)   = xyabcyx  // xy..yx
  * /pre
  *
  * @param enclosee the String to be enclosed
  * @param either of such pairs of strings as given above
  */
 StringUtils.enclose(String enclosee, String encloser)


 /**
  * pre
  * StringUtils.lead(abc, zz)  = zzabc
  * /pre
  */
 StringUtils.lead(String leadee, String leadStr)
 StringUtils.lead(String leadee, String leadChar)
 /**
  * pre
  * StringUtils.lead(abc, '.', 3)  = abc...
  */
 StringUtils.lead(String leadee, char leadStr,   int repeatCount)
 StringUtils.lead(String leadee, String leadStr, int repeatCount)
 /**
  * pre
  * StringUtils.trail(abc, zz)  = abczz
  * /pre
  */
 StringUtils.trail(String trailee, String trailStr)
 StringUtils.trail(String trailee, char trailChar)
 StringUtils.trail(String trailee, String trailStr, int repeatCount)
 StringUtils.trail(String trailee, char trailChar, int repeatCount)


 /**
  * The concept of naught.
  * True if the String is null or null.
  * pre
  * StringUtils.isNaught(abc) = false
  * StringUtils.isNaught(null)  = true
  * StringUtils.isNaught(null) = true
  * /pre
  */
 StringUtils.isNaught(String str)


 // ArrayUtils methods

 /**
  * Similar to the existing codetoString/code but
  * using delimiter given.
  */
 ArrayUtils.toString(Object array, String delimiter)
 ArrayUtils.toString(Object array, char delimiter)
 /**
  * A codetoString/code that emits only a given part
  * of the array.
  */
 ArrayUtils.toString(Object arr, int startIndex, int endIndex)


 /**
  * Obtain a new array of the given size, with the elements
  * present between startIndex (inclusive) and endIndex (exclusive).
  */
 ArrayUtils.subarray(arr, startIndex, endIndex)


---




The concept of a naught String.

A String is naught if it is either 'null' or is the literal null.

I have often encountered this situation in my JSP project where a 
particular
parameter is passed in
as x=null, and I need to insert code everytime saying if(x == null ||
x.equals(null))

_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[lang][codec] Test Matrix [WAS:Sanity checking a client project b uild]

2003-11-23 Thread Gary Gregory
How about something like:

Example: 
http://cvs.apache.org/~ggregory/test-platforms/docs/test-platforms.example.x
ml

XML Schema: 
http://cvs.apache.org/~ggregory/test-platforms/test-platforms.xsd

XML Schema docs: 
http://cvs.apache.org/~ggregory/test-platforms/docs/test-platforms.html

The XML could in turn be turned in HTML by a Maven doo-dad.
?

Gary

 -Original Message-
 From: Phil Steitz [mailto:[EMAIL PROTECTED]
 Sent: Friday, November 21, 2003 20:34
 To: Jakarta Commons Developers List
 Subject: Re: [lang][codec] Sanity checking a client project build
 
 John Keyes wrote:
 
  On 21 Nov 2003, at 18:49, __matthewHawthorne wrote:
 
  I agree with the idea about testing all Java versions.  Testing all
  platforms is important too.  In theory, it seems like we need some
  type of text matrix, in which we identify all platforms and JREs that
  the software has been tested on.
 
  Something like:
 
   1.21.31.4
  Solaris   x
  Linux x  x   x
  Windows  x
  BSD   x  x
  Mac OSX  x   x
 
  Even if we are not able to access every version on every platform, it
  would be nice to see this information.  Users who have access to an
  untested platform could volunteer to run the tests and submit the
  results.
 
  Is this overkill?
 
 
  Well I think we should document what we've tested it on.  As Jakarta
  is geared towards server side software this is a great idea.
 
 I agree. We actually went through some of this fun in the run up to lang
 2.0.  I tested using Sun's Linux JDKs 1.2, 1.3 and 1.4 and IIRC, Stephen
   or Henri ran tests on Windoz.  I can't remember exactly which versions
 and what we had to do to get some of the tests to run under the pre-1.4
 JDKs.  We probably should document this and include a statement in the
 release notes.
 
 The same comments hold true for performance tests.  I have been planning
 for some time to set up some performance tests for lang, similar to what
 Craig did for BeanUtils. Any volunteers to help with this?  We could
 gather and publish the test results, along with the platform
 compatablity tests on the lang web site.  I will eventually get to this,
 but I am a bit time constrained at the moment.
 
 Phil
 
  -John K
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


Re: [io] xdocs/changes.xml

2003-11-23 Thread Jeremias Maerki
I know. I did it because I got an empty CVS Changelog on my machine when
generating the site using Maven (1.0-rc1). I don't know why it didn't
work.

On 23.11.2003 21:47:02 Henri Yandell wrote:
 So what's the point of this file then?
 
 It looks like a manual version of a CVS Changelog.


Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [lang][codec] Test Matrix [WAS:Sanity checking a client project build]

2003-11-23 Thread Phil Steitz
Gary Gregory wrote:
How about something like:

Example: 
http://cvs.apache.org/~ggregory/test-platforms/docs/test-platforms.example.x
ml

XML Schema: 
http://cvs.apache.org/~ggregory/test-platforms/test-platforms.xsd

XML Schema docs: 
http://cvs.apache.org/~ggregory/test-platforms/docs/test-platforms.html

The XML could in turn be turned in HTML by a Maven doo-dad.
?
Gary

Cool!  Might want to add a placeholder for more OS info than just OS 
name and version (build number, patch level, service pack, etc.) and, if 
we use the same schema for performance tests, machine characteristics.

What would really nice would be some way to gather at least the basic 
info and generate the xml as part of the test process, so folks could 
post xml test reports and we could merge them into the site docs 
somehow. I guess step 0 is to get the schema defined for the test reports.

What are you using to generate this stuff?

Phil



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [io] Current plan?

2003-11-23 Thread Jeremias Maerki
Thanks for helping out!

I'm not sure that the last words have been spoken about this. IMHO most
of the deprecated methods using String parameters shouldn't be put into
IO, at least not the ones that can have the same signature with File
parameters (forceDelete etc.). They encourage bad practice. java.io.File
is much safer to work with (ex. considering the path separators). I've
encountered a lot of buggy code where people concatenated paths or got
problems with double path separators.

On 23.11.2003 21:21:04 Henri Yandell wrote:
 
 
 On Sun, 23 Nov 2003, Jeremias Maerki wrote:
 
  there was to say. Now it's already better and one of the next steps is
  to create a FilenameUtils class with methods for people who work with
  filenames instead of java.io.File. FileUtils is reserved for
  java.io.File.
 
 Okay. I can get to work on this.
 
 The deprecated methods should be removed or goto FilenameUtils?

Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [io] Current plan?

2003-11-23 Thread Henri Yandell

On Sun, 23 Nov 2003, Jeremias Maerki wrote:

 Thanks for helping out!

No problem. I've been meaning to try and get IO out for 2 years now.

 I'm not sure that the last words have been spoken about this. IMHO most
 of the deprecated methods using String parameters shouldn't be put into
 IO, at least not the ones that can have the same signature with File

I agree.

Hen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [io] xdocs/changes.xml

2003-11-23 Thread Henri Yandell

I get that sometimes too. I've found the SCM stuff in maven to be very
tricky to get right in the project.xml.

It'll be fixable, so the changes.xml should be unnecessary.

Hen

On Sun, 23 Nov 2003, Jeremias Maerki wrote:

 I know. I did it because I got an empty CVS Changelog on my machine when
 generating the site using Maven (1.0-rc1). I don't know why it didn't
 work.

 On 23.11.2003 21:47:02 Henri Yandell wrote:
  So what's the point of this file then?
 
  It looks like a manual version of a CVS Changelog.


 Jeremias Maerki


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io BeanRuleSet.java

2003-11-23 Thread mvdb
mvdb2003/11/23 17:58:24

  Modified:betwixt/src/java/org/apache/commons/betwixt/io
BeanRuleSet.java
  Added:   betwixt/src/test/org/apache/commons/betwixt/dotbetwixt
MsgBean.betwixt MsgBean.java MsgParserTest.java
  Log:
   The problem fixed here is that an element without an updater would
   not process it's attributes correctly even though they had updaters when creating 
the bean.
  Thanx to Mike Stanly for spotting this and supplying a testcase for it.
  (I refactored the testcase a bit, so all original exceptions are thrown nicely) and 
to put the test into 1 class (except for the bean)
  
  Permission from Mike was granted to add his test to betwixt through this mail: 
  http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]msgId=1122934
  
  
  
  Revision  ChangesPath
  1.1  
jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/dotbetwixt/MsgBean.betwixt
  
  Index: MsgBean.betwixt
  ===
  ?xml version=1.0 encoding=UTF-8?
  info
element name=message
attribute name=type property=type/
attribute name=to property=toAddress/
attribute name=from property=fromAddress/ 
element name=body
attribute name=name property=name/
attribute name=status property=status/
element name=description property=description/
element name=optional
element name=field-1
attribute name=value 
property=optionalField1/
/element
element name=field-2
attribute name=value 
property=optionalField2/
/element
/element
/element
/element
  /info
  
  
  
  1.1  
jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/dotbetwixt/MsgBean.java
  
  Index: MsgBean.java
  ===
  /*
   * $Header: 
/home/cvs/jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/dotbetwixt/MsgBean.java,v
 1.1 2003/11/24 01:58:24 mvdb Exp $
   * $Revision: 1.1 $
   * $Date: 2003/11/24 01:58:24 $
   *
   * 
   * 
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *if any, must include the following acknowledgement:  
   *   This product includes software developed by the 
   *Apache Software Foundation (http://www.apache.org/).
   *Alternately, this acknowledgement may appear in the software itself,
   *if and wherever such third-party acknowledgements normally appear.
   *
   * 4. The names Apache, The Jakarta Project, Commons, and Apache Software
   *Foundation must not be used to endorse or promote products derived
   *from this software without prior written permission. For written 
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called Apache,
   *Apache nor may Apache appear in their names without prior 
   *written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * 
   *
   * 

cvs commit: jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/dotbetwixt TestMsgParser.java MsgParserTest.java

2003-11-23 Thread mvdb
mvdb2003/11/23 18:02:19

  Added:   betwixt/src/test/org/apache/commons/betwixt/dotbetwixt
TestMsgParser.java
  Removed: betwixt/src/test/org/apache/commons/betwixt/dotbetwixt
MsgParserTest.java
  Log:
  Renaming new testclass to start with Test, conforming to all the other testcases..
  
  Revision  ChangesPath
  1.1  
jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/dotbetwixt/TestMsgParser.java
  
  Index: TestMsgParser.java
  ===
  /*
   * $Header: 
/home/cvs/jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/dotbetwixt/TestMsgParser.java,v
 1.1 2003/11/24 02:02:19 mvdb Exp $
   * $Revision: 1.1 $
   * $Date: 2003/11/24 02:02:19 $
   *
   * 
   * 
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *if any, must include the following acknowledgement:  
   *   This product includes software developed by the 
   *Apache Software Foundation (http://www.apache.org/).
   *Alternately, this acknowledgement may appear in the software itself,
   *if and wherever such third-party acknowledgements normally appear.
   *
   * 4. The names Apache, The Jakarta Project, Commons, and Apache Software
   *Foundation must not be used to endorse or promote products derived
   *from this software without prior written permission. For written 
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called Apache,
   *Apache nor may Apache appear in their names without prior 
   *written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * 
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * http://www.apache.org/.
   *
   */ 
   package org.apache.commons.betwixt.dotbetwixt;
  
  import java.io.StringReader;
  import java.io.StringWriter;
  
  import org.apache.commons.betwixt.io.BeanReader;
  import org.apache.commons.betwixt.io.BeanWriter;
  
  import junit.framework.TestCase;
  /**
   * Tests the marshalling and unmarshalling of MsgBeans with Betwixt.
   * The problem tested here is that an element without an updater would
   * not process it's attributes correctly even though they had updaters.
   * 
   * @author a href=[EMAIL PROTECTED]Mike Stanley/a
   * @version $Id: TestMsgParser.java,v 1.1 2003/11/24 02:02:19 mvdb Exp $
   */
  public class TestMsgParser extends TestCase
  {
  private static final String XML_PROLOG = ?xml version='1.0' ?\n;
  private MsgBean msg;
  
  /*
   * @see TestCase#setUp()
   */
  protected void setUp() throws Exception
  {
  msg = new MsgBean();
  msg.setDescription(Some simple descriptive text);
  msg.setToAddress([EMAIL PROTECTED]);
  msg.setFromAddress([EMAIL PROTECTED]);
  msg.setName(basicMsg);
  msg.setOptionalField1(7-12-99);
  msg.setOptionalField2(true);
  msg.setStatus(sent);
  msg.setType(spam);
  }
  
  public void testGetAsXml() throws Exception
  {
  String xmlMsg = null;
  xmlMsg = getAsXml(msg);
 

RE: [betwixt] Betwixt troubles...

2003-11-23 Thread Martin van den Bemt
Hi Mike,

A lot later than anticipated, but finally got some time for betwixt last
night :) 
The reason why it doesn't work for you has 2 reasons : 
1) Your .betwixt is incorrect (explaining the exceptions) (see CVS for a
good one). You HAVE to have the name property in an element and
attribute element.
2) There was indeed a bug in betwixt that prevented elements without any
updater (in your case a setBody() , to set the attribute values in the 
bean (in your case setName and setStatus). Betwixt now checks to see if
there are any attributes present and tries to set values in that
scenario.

Hope this helps and not too late ;)

Mvgr,
Martin

On Wed, 2003-11-12 at 15:37, Mike Stanley wrote:
 ok.
 
 and yes you have permission to use it in any way that matters.  I just
 looked it over though, and I accidentally included copyright disclaimers at
 the top of some of the files.  I will resend them without the disclaimers.
 It was written from scratch, no real world code used, completely
 fictitious -- my class templates include the disclaimer and I just forgot to
 remove it in some places.  I can either resend it with this stuff removed -
 or - give you permission to remove it and add the APL to it.  Whatever
 satisfies the legal requirement.  Your call.
 
 Thanks, and like I said before I'd be more than happy to look into / patch
 the issue(s).  Just waiting for confirmation.
 
 - Mike
 
  -Original Message-
  From: Martin van den Bemt [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, November 12, 2003 9:21 AM
  To: Jakarta Commons Developers List
  Subject: RE: [betwixt] Betwixt troubles...
 
 
  I'll try to find some time to confirm it tonight, but since a lot of
  family matters atm, that time can be consumed by that..
  Do we have permission (when needed) to add your scenario to the betwixt
  CVS tree ? (and therefor give it an apache license?)
 
  Mvgr,
  Martin
 
  On Wed, 2003-11-12 at 15:12, Mike Stanley wrote:
   Please confirm this is a bug, or please offer some advice on
  what I'm doing
   wrong.  If this isn't sufficient to confirm the bug please let
  me know, and
   I will modify the example.
  
   - Mike
  
-Original Message-
From: Mike Stanley [mailto:[EMAIL PROTECTED]
Sent: Monday, November 10, 2003 2:07 PM
To: Jakarta Commons Developers List
Subject: RE: [betwixt] Betwixt troubles...
   
   
here is a zipped up eclipse project (minus the jar dependencies).
 There is
a unit test that demonstrates the bug that I'm talking about.
The unit test
has to test methods, testGetAsXml which passes, and testParseMsg which
fails.
   
Aside from the betwixt dependencies, this project is also dependent on
log4j, and commons-lang.  Hope this provides a decent enough
  demo of the
bugs.
   
Note: I've tried this with the alpha release of betwixt, as
  well as the
snapshot from 2/11/2003.  When using the snapshot, the
  testGetAsXml fails
with a null pointer exception.  The alpha release shows the
marshalling/unmarshalling behavior noted in this thread.  I also tried
variations on the parser configurations.
   
Thanks for the help.
- Mike
   
 -Original Message-
 From: Martin van den Bemt [mailto:[EMAIL PROTECTED]
 Sent: Sunday, November 09, 2003 12:14 PM
 To: Jakarta Commons Developers List
 Subject: RE: Betwixt troubles...


 Can you supply us with a tescase that shows us the
  bahaviour (esp that
 you believe it is a bug), since there is too little info in
  the mail to
 test this (we needs the beans / bean. One thing I know is that eg
 Bean.betwixt files only supplies beaninfo for Bean.java and
  not for any
 classes embedded in Bean.java.

 Mvgr,
 Martin

 On Fri, 2003-11-07 at 19:51, Mike Stanley wrote:
  Please note: I sent this to the developers list and not the
users list,
  because I believe it to be a bug, and if confirmed - I
  may patch it.
 
  - Mike
 
   -Original Message-
   From: Mike Stanley [mailto:[EMAIL PROTECTED]
   Sent: Friday, November 07, 2003 1:26 PM
   To: Jakarta Commons Dev
   Subject: Betwixt troubles...
  
  
   Hey everyone,
  
   I'm running into an issue with some Betwixt code.  I'm trying to
   Write/Read
   a bean associated with .betwixt file.
  
   I can't seem to get attributes to be set when reading in the
 xml.  writing
   works fine.  I've tried several ways (including defaulting to
   primitiveTypes
   and specificing an updater method).  Here is the content of
the file:
  
   ?xml version=1.0 encoding=UTF-8?
   info primitiveTypes=attribute
   element name=rcss
   attribute property=type/
   element name=requests
   element name=isValid
   element name=agent-id
   attribute 

[collections] CaseInsensitiveHashMap

2003-11-23 Thread Phil Steitz
A few weeks back, David Graham submitted code for a 
CaseInsensitiveHashMap here:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24537

This looks like a good addition to [collections] to me.

Any objections to my coding up some tests and adding this class to the 
map package?

Phil

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [site] Non-Maven web sites

2003-11-23 Thread Phil Steitz
robert burrell donkin wrote:
On 22 Nov 2003, at 21:09, Noel J. Bergman wrote:

snip

there are also some features that many of these web sites use that are
not (easily) available through maven.


Have these been raised to the Maven project?


it's mainly access to information related to a particular release. this 
is static and is currently not stored in cvs. it should just be a case 
of some careful re-organization.
What I did in [lang] (which I am about to remove pending resolution of 
the cvs placement issue) was to use the existing link in the body of the 
main page to the release javadoc (leaving the files in place) and 
allow the Maven project reports section to point to the current 
javadoc. That seems natural to me and I don't think that this kind of 
thing will be that hard to handle. It will just require that we maintain 
directories for the non-maven generated content and correct links in the 
xdocs.

After reviewing the archives and doing some more research, I now 
understand fully the rationale for storing all HTML in cvs and I don't 
think that there is much value in debating this issue any more.  Sorry 
if I was beating a dead horse above.

That said, to move forward with [lang] and [collections] I need a place 
to commit the maven-generated HTML.  I could just add it all into 
jakarta-commons/lang (resp. collections). Is that what I should do 
(adding the other files in the current site that aren't in cvs as well)?

Phil

- robert

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [collections] CaseInsensitiveHashMap

2003-11-23 Thread Brian S O'Neill
This implementation converts the key to lowercase on every get and put, 
which adds a bit of object allocation overhead. Also, simply converting 
to lowercase does not make it fully case-insensitive. There is a comment 
in String.regionMatches that brings up something about the Georgian 
alphabet.

What I always do when I want a case-insensitive map is to construct a 
TreeMap with String.CASE_INSENSITIVE_ORDER.

Phil Steitz wrote:

A few weeks back, David Graham submitted code for a 
CaseInsensitiveHashMap here:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24537

This looks like a good addition to [collections] to me.

Any objections to my coding up some tests and adding this class to the 
map package?

Phil

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [io] remove old ant build system

2003-11-23 Thread dion
Jeremias Maerki [EMAIL PROTECTED] wrote on 23/11/2003 09:54:45 
PM:

 Right. How are other commons projects handling that? Maven claims to
 integrate with Gump but still, I see quite a few projects still having a
 build.xml and some having a (generated) build-gump.xml. Any
 recommendations?

Gump can't run maven 'natively' as it can Ant. You'll need to keep the 
build.xml around.
--
dIon Gillard, Multitask Consulting
Blog:  http://blogs.codehaus.org/people/dion/





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Betwixt bug as well it seems... (sigh)

2003-11-23 Thread Martin van den Bemt
Hi Gus,

Could you have a go at the latest betwixt build (just committed a fix to
cvs, which sounds a bit similar to your situation). If that is still not
working, it would be nice to have a testcase of some kind to make my
life a bit easier (don't know if commons-sql moved to db commons,
although it doesn't seem like it ?)
I'll keep ojb-user on the cc, if that's ok (please keep commons-dev on
the cc too,since I am not subscribed to ojb-user.. 

Mvgr,
Martin

On Fri, 2003-11-21 at 23:46, Gus Heck wrote:
 In light of this, I decided to enable further development by setting the 
 missing username and password for now until the bug can be resolved. 
 When I did I got more funny results that look very much like a bug... 
 The following code:
 
 InputStream is = 
 Thread.currentThread().getContextClassLoader().getResourceAsStream(project_schema.xml);
 Database db = null;
 try {
 DatabaseReader reader = new DatabaseReader();
 db = (Database) reader.parse( is );
 } catch (IntrospectionException ie) {
 throw new RuntimeException(Error creating DatabaseReader 
 for project_schema.xml);
 } catch (IOException ioe ) {
 throw new RuntimeException(Error loading project_schema.xml);
 } catch (SAXException saxe ) {
 throw new RuntimeException(Error parsing project_schema.xml);
 }
 
 System.out.println(db);
 for (Iterator iter = db.getTables().iterator();iter.hasNext();) {
 org.apache.commons.sql.model.Table t
 = (org.apache.commons.sql.model.Table) iter.next();
 System.out.println(t);
 System.out.println(t.getName());   
 }
 
 produces the following output:
 
 [EMAIL PROTECTED];tableCount=1]
 [EMAIL PROTECTED]
 null
 
 The number of tables is correct, but I feel certain that it should not 
 be named null giventhe following project_schema.xml (still in defaults 
 for the field sizes... I'll deal with that after I write something to 
 the database successfully):
 
 database name=fdbtest2
 table name=LocationBase
 column name=id
 javaName=id
 type=INTEGER
 primaryKey=true
 required=true
 /
 column name=country
 javaName=country
 type=VARCHAR
 size=24
 /
 column name=stateOrRegion
 javaName=stateOrRegion
 type=VARCHAR
 size=24
 /
 column name=subRegion
 javaName=subRegion
 type=VARCHAR
 size=24
 /
 column name=city
 javaName=city
 type=VARCHAR
 size=24
 /
 /table
 /database
 
 Sadly it appears that commons-sql's DatabaseReader is just a fairly 
 simple extension of a betwixt BeanReader...
 
 package org.apache.commons.sql.io;
 
 import java.beans.IntrospectionException;
 
 import org.apache.commons.betwixt.XMLIntrospector;
 import org.apache.commons.betwixt.io.BeanReader;
 import org.apache.commons.betwixt.strategy.HyphenatedNameMapper;
 import org.apache.commons.sql.model.Database;
 
 /**
  * This class parsers XML and creates a fully populated Database bean.
  * This class is-a Digester and so can support configuration via custom 
 rules.
  *
  * @author a href=mailto:[EMAIL PROTECTED]James Strachan/a
  * @version $Revision: 1.14 $
  */
 public class DatabaseReader extends BeanReader {

 public DatabaseReader() throws IntrospectionException {
 setXMLIntrospector( newXMLIntrospector() );
 registerBeanClass(Database.class);
 }
 
 /**
  * A factory method to create the default introspector used to turn
  * the Database object model into XML
  */   
 protected static XMLIntrospector newXMLIntrospector() {
 XMLIntrospector introspector = new XMLIntrospector();
 
 // configure the style of the XML, to brief and attribute based
 introspector.setAttributesForPrimitives(true);
 introspector.setWrapCollectionsInElement(false);
 
 // set the mixed case name mapper
 introspector.setElementNameMapper(new HyphenatedNameMapper());
 //introspector.setElementNameMapper(new DecapitalizeNameMapper());
 
 return introspector;
 }
 }
 
 
 and so this is probably a betwixt bug. I hope someone who understands 
 betwixt can verify this (hence the cross post to commons-dev).
 
 -Gus
 
 
 
 Andy Malakov wrote:
 
 Hello All,
 
 It looks like a bug:
 
 Class o.a.ojb.broker.metadata.MetadataManager.copyOfGlobalRepository() uses 
 SerializationUtils.clone() to return a copy of OJB
 repository. At the same time some objects in repository graph have transient fields 
 which become un-initialized (null) after the
 clone.
 
 For example, o.a.ojb.broker.metadata.fieldaccess.AnonymousPersistentField has 
 

DO NOT REPLY [Bug 24352] - NLTM Proxy and basic host authorization

2003-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24352.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24352

NLTM Proxy and basic host authorization





--- Additional Comments From [EMAIL PROTECTED]  2003-11-24 03:03 ---
Created an attachment (id=9255)
2.0 Patch 3

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]