logging: WeakHashtable

2004-11-10 Thread Brian Stansberry

Hi Robert,
 
Had a little time to look at the WeakHashtable.  Much cleaner w/o reflection!
 
A couple things occurred to me as I looked.
 
1)  The instances of Referenced are not cleared from the underlying table if their underlying references are cleared.
2)  Passing null keys/values to put() does not result in a NPE.
 
I attached a patch to the WeakHashtableTest that tests for these.
 
One thought on #1 is to make Referenced a subclass of WeakReference instead of a wrapper.  You can then keep a ReferenceQueue and poll it to remove cleared references from the hashtable whenever get() is called.  This is similar to what WeakHashMap does.
 
Best,
 
Brian Stansberry
	
		Do you Yahoo!? 
Check out the new Yahoo! Front Page. www.yahoo.comIndex: WeakHashtableTest.java
===
RCS file: 
/home/cvspublic/jakarta-commons/logging/optional/src/test/org/apache/commons/logging/impl/WeakHashtableTest.java,v
retrieving revision 1.1
diff -u -r1.1 WeakHashtableTest.java
--- WeakHashtableTest.java  10 Nov 2004 22:59:54 -  1.1
+++ WeakHashtableTest.java  11 Nov 2004 07:04:14 -
@@ -153,6 +153,24 @@
 weakHashtable.put(anotherKey, new Long(1066));
 
 assertEquals(new Long(1066), weakHashtable.get(anotherKey));
+
+// Test compliance with the hashtable API re nulls
+Exception caught = null;
+try {
+weakHashtable.put(null, new Object());
+}
+catch (Exception e) {
+caught = e;
+}
+assertNotNull("did not throw an exception adding a null key", caught);
+caught = null;
+try {
+weakHashtable.put(new Object(), null);
+}
+catch (Exception e) {
+caught = e;
+}
+assertNotNull("did not throw an exception adding a null value", 
caught);
 }
 
 /** Tests public void putAll(MapÊt) */
@@ -214,5 +232,8 @@
 bytz = bytz * 2;
 }
 }
+
+// Test that the released objects are not taking space in the table
+assertEquals("underlying table not emptied", 0, weakHashtable.size());
 }
 }

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

[DBCP] Deadlocks in DriverManager.getConnection

2004-11-10 Thread Lars Torunski
Hi,
the Apache commons dbcp (1.2.1) is using DriverManager.getConnection to 
get database connections. We had a lot of deadlock situations using this 
method with and without using connection pooling libraries. According to 
http://e-docs.bea.com/wls/docs81/faq/jdbc.html#501044 this method is 
really deadlock prone:

Q. Why should I not use DriverManager.getConnection?
A. DriverManager.getConnection can cause a deadlock. In the server, all 
DriverManager calls are class-synchronized including many frequent calls 
that all drivers make, and JDBC drivers do a lot of synchronization 
internally. One long-waiting call can stop all JDBC work in the whole 
JVM and cause deadlocks. Also, you should not reregister the driver 
repeatedly. Regardless of the DBMS state, the one driver that is 
initially loaded at startup will always work.

After some help from the BEA Support Team we are using Driver.connect 
now and we havn't run into any deadlock situation again.

I reviewed serveral mailing list but I didn't find any information about 
this. OK, a lot of people will increase the pool size if they run into a 
similar situation. But this doesn't solve the real problem of 
DriverManager.getConnection.

After I spoke with Steve Waldman (maintainer of c3p0), he fixed the 
problem in c3p0-0.8.5-pre7 (https://sourceforge.net/projects/c3p0/ ).

Does have anybody experiences with this class and method?
Thanks,
Lars
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache

2004-11-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31286

Memory leaks in JBoss due to LogFactory cache





--- Additional Comments From [EMAIL PROTECTED]  2004-11-11 06:51 ---
I'll look this over as carefully as I can and try to add a few tests.  I've 
got a couple thoughts, but I'll post to the commons-dev list to keep from 
filling up Bugzilla.

Re adding my name, at this point you've done all the work :)  If I'm able to 
make any further significant contributions to this, please feel free to add my 
name.

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



cvs commit: jakarta-commons/validator project.xml

2004-11-10 Thread niallp
niallp  2004/11/10 17:59:00

  Modified:validator project.xml
  Log:
  Add myself to project.xml
  
  Revision  ChangesPath
  1.53  +6 -0  jakarta-commons/validator/project.xml
  
  Index: project.xml
  ===
  RCS file: /home/cvs/jakarta-commons/validator/project.xml,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- project.xml   4 Oct 2004 03:54:46 -   1.52
  +++ project.xml   11 Nov 2004 01:59:00 -  1.53
  @@ -128,6 +128,12 @@
 jmitchell NOSPAM apache.org
 EdgeTech, Inc
   
  +
  +  Niall Pemberton
  +  niallp
  +  niallp NOSPAM apache.org
  +  
  +
  
 
 
  
  
  

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



[PATCH] collections: Fix static access warning in buffer test

2004-11-10 Thread Chris Tilden
### I opened the collections source using Eclipse 3.0.1 and noticed a
### warning this patch fixes that warning.
Index: 
collections/src/test/org/apache/commons/collections/buffer/TestBlockingBuffer.java
===
--- 
a/collections/src/test/org/apache/commons/collections/buffer/TestBlockingBuffer.java
   2004-11-08 13:24:19.533550608 -0800
+++ 
b/collections/src/test/org/apache/commons/collections/buffer/TestBlockingBuffer.java
   2004-11-08 13:34:05.793425560 -0800
@@ -380,7 +380,7 @@

 try {
 // wait for other thread to block on get() or remove()
-Thread.currentThread().sleep(100);
+Thread.sleep(100);
 }
 catch (InterruptedException e) {}

@@ -403,7 +403,7 @@

 try {
 // wait for other thread to block on get() or remove()
-Thread.currentThread().sleep(100);
+Thread.sleep(100);
 }
 catch (InterruptedException e) {}

@@ -481,7 +481,7 @@

 private void delay(){
 try {
-Thread.currentThread().sleep(100);
+Thread.sleep(100);
 } catch (InterruptedException e) {}
 }

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



[PATCH] collections: Fix static access warning in TreeBidiMap

2004-11-10 Thread Chris Tilden
### I opened the collections source using Eclipse 3.0.1 and noticed a
### warning, this patch fixes that warning.
Index: 
collections/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java
===
--- 
a/collections/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java
 2004-11-08 13:24:19.512553800 -0800
+++ 
b/collections/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java
 2004-11-08 13:33:53.112353376 -0800
@@ -1612,7 +1612,7 @@
 expectedModifications++;
 lastReturnedNode = null;
 if (nextNode == null) {
-previousNode =
main.greatestNode(main.rootNode[orderType], orderType);
+previousNode =
TreeBidiMap.greatestNode(main.rootNode[orderType], orderType);
 } else {
 previousNode = main.nextSmaller(nextNode, orderType);
 }
@@ -1674,7 +1674,7 @@
  */
 EntryView(final TreeBidiMap main, final int orderType, final
int dataType) {
 super(main, orderType, dataType);
-this.oppositeType = main.oppositeIndex(orderType);
+this.oppositeType = TreeBidiMap.oppositeIndex(orderType);
 }

 public boolean contains(Object obj) {
@@ -1979,14 +1979,14 @@
 if (main.nodeCount == 0) {
 throw new NoSuchElementException("Map is empty");
 }
-return main.leastNode(main.rootNode[VALUE], VALUE).getValue();
+return TreeBidiMap.leastNode(main.rootNode[VALUE],
VALUE).getValue();
 }

 public Object lastKey() {
 if (main.nodeCount == 0) {
 throw new NoSuchElementException("Map is empty");
 }
-return main.greatestNode(main.rootNode[VALUE], VALUE).getValue();
+return TreeBidiMap.greatestNode(main.rootNode[VALUE],
VALUE).getValue();
 }

 public Object nextKey(Object key) {

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



[Jakarta Commons Wiki] Updated: Jelly

2004-11-10 Thread commons-dev
   Date: 2004-11-10T17:03:11
   Editor: DionGillard <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: Jelly
   URL: http://wiki.apache.org/jakarta-commons/Jelly

   no comment

Change Log:

--
@@ -1,5 +1,5 @@
 ##language:en
-= Component Overview =
+= Overview =
 Jelly is a tool for turning XML into executable code. So Jelly is a Java and 
XML based scripting and processing engine. Jelly can be used as a more flexible 
and powerful front end to Ant  such as in the Maven  project, as a testing 
framework such as JellyUnit  , in an intergration or workflow system such as 
werkflow  or as a page templating system inside engines like Cocoon  .
 
 Jelly borrows many good ideas from both JSP custom tags, Velocity, Cocoon, 
Ant. Jelly can be used from the command line, inside Ant and Maven or inside a 
Servlet, Web Service, JMS MessageListener or embedded directly into your 
software.

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



[Jakarta Commons Wiki] Updated: Jelly

2004-11-10 Thread commons-dev
   Date: 2004-11-10T17:02:40
   Editor: DionGillard <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: Jelly
   URL: http://wiki.apache.org/jakarta-commons/Jelly

   no comment

Change Log:

--
@@ -1,3 +1,5 @@
+##language:en
+= Component Overview =
 Jelly is a tool for turning XML into executable code. So Jelly is a Java and 
XML based scripting and processing engine. Jelly can be used as a more flexible 
and powerful front end to Ant  such as in the Maven  project, as a testing 
framework such as JellyUnit  , in an intergration or workflow system such as 
werkflow  or as a page templating system inside engines like Cocoon  .
 
 Jelly borrows many good ideas from both JSP custom tags, Velocity, Cocoon, 
Ant. Jelly can be used from the command line, inside Ant and Maven or inside a 
Servlet, Web Service, JMS MessageListener or embedded directly into your 
software.
@@ -7,3 +9,10 @@
 Jelly is completely extendable via custom tags in a similar way to JSP custom 
tags or Ant tasks. Though Jelly is really simple and has no dependencies either 
Servlets or JSP. So you could think of Jelly as similar to an XML-ized Velocity 
where the directives are XML tags. Or you could think of Jelly as a more 
flexible engine for processing Ant tasks with better expression, logic and 
looping support.
 
 Jelly is also based on an XML pipeline architecture, like Cocoon, so that it 
is ideal for processing XML, scripting web services, generating dynamic web 
content or being part of a content generation system such as Cocoon. 
+= External Resources =
+
+ ||Do you have a good example, add it here!||
+
+= FAQ =
+
+ ||Add your questions/answers here.||

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



[Jakarta Commons Wiki] New: Jelly

2004-11-10 Thread commons-dev
   Date: 2004-11-10T16:48:43
   Editor: DionGillard <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: Jelly
   URL: http://wiki.apache.org/jakarta-commons/Jelly

   no comment

New Page:

Jelly is a tool for turning XML into executable code. So Jelly is a Java and 
XML based scripting and processing engine. Jelly can be used as a more flexible 
and powerful front end to Ant  such as in the Maven  project, as a testing 
framework such as JellyUnit  , in an intergration or workflow system such as 
werkflow  or as a page templating system inside engines like Cocoon  .

Jelly borrows many good ideas from both JSP custom tags, Velocity, Cocoon, Ant. 
Jelly can be used from the command line, inside Ant and Maven or inside a 
Servlet, Web Service, JMS MessageListener or embedded directly into your 
software.

Jelly has native support for a Velocity-like expression language called Jexl 
which is a superset of the JSP, JSTL and JSF expression languages as well as 
support for other pluggable expression languages like XPath via Jaxen , 
JavaScript, beanshell and Jython.

Jelly is completely extendable via custom tags in a similar way to JSP custom 
tags or Ant tasks. Though Jelly is really simple and has no dependencies either 
Servlets or JSP. So you could think of Jelly as similar to an XML-ized Velocity 
where the directives are XML tags. Or you could think of Jelly as a more 
flexible engine for processing Ant tasks with better expression, logic and 
looping support.

Jelly is also based on an XML pipeline architecture, like Cocoon, so that it is 
ideal for processing XML, scripting web services, generating dynamic web 
content or being part of a content generation system such as Cocoon. 

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



[Jakarta Commons Wiki] Updated: FrontPage

2004-11-10 Thread commons-dev
   Date: 2004-11-10T16:48:06
   Editor: DionGillard <[EMAIL PROTECTED]>
   Wiki: Jakarta Commons Wiki
   Page: FrontPage
   URL: http://wiki.apache.org/jakarta-commons/FrontPage

   no comment

Change Log:

--
@@ -20,6 +20,7 @@
  * [:HttpClient] - !HttpClient provides a framework for working with the 
client-side of the HTTP protocol.
  * [:IO] - IO library inlcuding utility classes, stream implementations, file 
filters and endian classes.
  * [:JEXL] - A velocity-esque expression interpreter
+ * [:Jelly] - A XML-based scripting language
  * [:Lang] - Lang provides a set of common utilities that should be provided 
by the JDK, including String handling, Object and Date helpers, nested 
exceptions and enumerated types.
  * [:Launcher] -  The Launcher component is designed to be a cross platform 
Java application launcher. It eliminates the need for a batch or shell script 
to launch a Java class.
  * [:Logging] is a thin, modular bridging API with out-of-the-box support for 
the most well known logging system

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



Re: [all] (reprise) links to books (and similar resources)

2004-11-10 Thread Niall Pemberton
I agree with Martin, put them on the wiki and it takes away the hassle of
having to maintain them.  Seems to work well in Struts:

http://wiki.apache.org/struts/StrutsBooks

Niall

- Original Message - 
From: "robert burrell donkin" <[EMAIL PROTECTED]>
To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]>
Sent: Wednesday, November 10, 2004 9:56 PM
Subject: Re: [all] (reprise) links to books (and similar resources)


> On 10 Nov 2004, at 21:44, Shapira, Yoav wrote:
>
> > Hi,
> >
> >>> the reason why the consensus moved from direct linking from a
> > resources
> >>> page on the site was that it might appear too much like an official
> >>> recommendation which may cause frictions within the community.
> >
> > FWIW, although I wasn't involved in this discussion (and certainly was
> > not part of "the consensus"), I disagree with the above.  As long as a
> > resources page clarifies that no endorsement or preference is being
> > made, and the same page is open to / inclusive of all relevant works, I
> > think that's fine.  It's like the vendors page off the Jakarta home
> > page.
> >
> > If everyone else thinks otherwise, that's fine, but just know that if
> > such a consensus exists, it's at best limited to commons only, and does
> > not apply to Jakarta in general (and other Apache TLPs).
>
> at the time, struts was going through a tough time working out what to
> do when some committers very strongly objected to the listing of some
> books. the jakarta vendor page has also proved very difficult. a
> document in cvs means has to be actively maintained by volunteers and
> the content approved (passively or actively). it can be argued that
> listing on an ASF page is a form of endorsement (and there's a general
> wariness about endorsements amongst some...).
>
> after long (and often painful) experience with the jakarta vendor page,
> i (for one) would not volunteer to create or maintain a page for books,
> so i'm probably -0 on including a page in the documentation.
>
> opinions?
>
> - 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]



DO NOT REPLY [Bug 31286] - Memory leaks in JBoss due to LogFactory cache

2004-11-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31286

Memory leaks in JBoss due to LogFactory cache





--- Additional Comments From [EMAIL PROTECTED]  2004-11-10 23:05 ---
I've checked in my changes. I'm going to leave the documentation for another 
day.

The idea is that the Hashtable implementation can be specified by a system 
property and (when the 
class is found on the classpath) defaults to the optional WeakHashtable. The 
idea is that a user (on a 
1.3+ JVM) should be able to drop in the commons-logging-optional.jar and have 
the classloaders 
garbaged collectable without further changes.

This is going to need some testing. I've added a few tests (if anyone wants to 
add more, please go 
ahead :) I'll probably post something on the lists tomorrow.

BTW Brian, I'm happy to add your name to the contributors and/or author tags if 
that is your wish.

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



cvs commit: jakarta-commons/logging/src/test/org/apache/commons/logging BadHashtablePropertyTest.java

2004-11-10 Thread rdonkin
rdonkin 2004/11/10 15:00:47

  Added:   logging/src/test/org/apache/commons/logging
BadHashtablePropertyTest.java
  Log:
  LogFactory's Hashtable implementation (used to store LogFactoryImpl by 
classloader) can now be subclassed. This will default to WeakHashtable when 
this is present on the classpath, Hashtable otherwise. The implementation class 
can be specified by a system property. Based on a contribution by Brian 
Stansberry.
  
  Revision  ChangesPath
  1.1  
jakarta-commons/logging/src/test/org/apache/commons/logging/BadHashtablePropertyTest.java
  
  Index: BadHashtablePropertyTest.java
  ===
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *  http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */ 
  
  package org.apache.commons.logging;
  
  import junit.framework.*;
  import java.util.Hashtable;
  
  /**
   * Tests behaviour when the property is misconfigured.
   */
  public class BadHashtablePropertyTest extends TestCase {
  
public BadHashtablePropertyTest(String testName) {
super(testName);
}
  
  public void testType()  {
  assertTrue(LogFactory.factories instanceof Hashtable);
  }
  
  public void testPutCalled() throws Exception {
  Log log = LogFactory.getLog(BadHashtablePropertyTest.class);
  }
  }
  
  
  

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



cvs commit: jakarta-commons/logging/src/test/org/apache/commons/logging AltHashtableTest.java

2004-11-10 Thread rdonkin
rdonkin 2004/11/10 15:00:30

  Added:   logging/src/test/org/apache/commons/logging
AltHashtableTest.java
  Log:
  LogFactory's Hashtable implementation (used to store LogFactoryImpl by 
classloader) can now be subclassed. This will default to WeakHashtable when 
this is present on the classpath, Hashtable otherwise. The implementation class 
can be specified by a system property. Based on a contribution by Brian 
Stansberry.
  
  Revision  ChangesPath
  1.1  
jakarta-commons/logging/src/test/org/apache/commons/logging/AltHashtableTest.java
  
  Index: AltHashtableTest.java
  ===
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *  http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */ 
  
  package org.apache.commons.logging;
  
  import junit.framework.*;
  
  public class AltHashtableTest extends TestCase {
  
public AltHashtableTest(String testName) {
super(testName);
}
  
  public void testType() {
  assertTrue(LogFactory.factories instanceof AltHashtable);
  }
  
  public void testPutCalled() throws Exception {
  
  AltHashtable.lastKey = null;
  AltHashtable.lastValue = null;
  ClassLoader classLoader = new ClassLoader() {};
  Thread thread = new Thread(
  new Runnable() {
  public void run() {
  LogFactory.getLog(AltHashtableTest.class);
  }
  }   
  );
  thread.setContextClassLoader(classLoader);
   
  thread.start();
  thread.join();
  
  assertEquals(classLoader, AltHashtable.lastKey);
  assertNotNull(AltHashtable.lastValue);
  }
  }
  
  
  

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



cvs commit: jakarta-commons/logging/src/test/org/apache/commons/logging AltHashtable.java

2004-11-10 Thread rdonkin
rdonkin 2004/11/10 15:00:10

  Added:   logging/src/test/org/apache/commons/logging
AltHashtable.java
  Log:
  LogFactory's Hashtable implementation (used to store LogFactoryImpl by 
classloader) can now be subclassed. This will default to WeakHashtable when 
this is present on the classpath, Hashtable otherwise. The implementation class 
can be specified by a system property. Based on a contribution by Brian 
Stansberry.
  
  Revision  ChangesPath
  1.1  
jakarta-commons/logging/src/test/org/apache/commons/logging/AltHashtable.java
  
  Index: AltHashtable.java
  ===
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *  http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */ 
  
  package org.apache.commons.logging;
  
  import java.util.Hashtable;
  
  public class AltHashtable extends Hashtable {
  
  public static Object lastKey;
  public static Object lastValue;
  
  public Object put(Object key, Object value) {
  lastKey = key;
  lastValue = value;
  return super.put(key, value);
  }
  }
  
  
  

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



cvs commit: jakarta-commons/logging/optional/src/test/org/apache/commons/logging/impl WeakHashtableTest.java

2004-11-10 Thread rdonkin
rdonkin 2004/11/10 14:59:55

  Added:   logging/optional/src/test/org/apache/commons/logging/impl
WeakHashtableTest.java
  Log:
  LogFactory's Hashtable implementation (used to store LogFactoryImpl by 
classloader) can now be subclassed. This will default to WeakHashtable when 
this is present on the classpath, Hashtable otherwise. The implementation class 
can be specified by a system property. Based on a contribution by Brian 
Stansberry.
  
  Revision  ChangesPath
  1.1  
jakarta-commons/logging/optional/src/test/org/apache/commons/logging/impl/WeakHashtableTest.java
  
  Index: WeakHashtableTest.java
  ===
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *  http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */ 
  
  
  package org.apache.commons.logging.impl;
  
  import junit.framework.*;
  import java.util.*;
  
  public class WeakHashtableTest extends TestCase {
  
  
  /** Maximum number of iterations before our test fails */
  private static final int MAX_GC_ITERATIONS = 50;
  
  private WeakHashtable weakHashtable;
  private Long keyOne;
  private Long keyTwo;
  private Long keyThree;
  private Long valueOne;
  private Long valueTwo;
  private Long valueThree;
  
  public WeakHashtableTest(String testName) {
  super(testName);
  }
  
  
  protected void setUp() throws Exception {
  super.setUp();
  weakHashtable = new WeakHashtable();
  
  keyOne = new Long(1);
  keyTwo = new Long(2);
  keyThree = new Long(3);
  valueOne = new Long(100);
  valueTwo = new Long(200);
  valueThree = new Long(300);
  
  weakHashtable.put(keyOne, valueOne);
  weakHashtable.put(keyTwo, valueTwo);
  weakHashtable.put(keyThree, valueThree);
  }
  
  /** Tests public boolean contains(ObjectÊvalue) */
  public void testContains() throws Exception {
  assertFalse(weakHashtable.contains(new Long(1)));
  assertFalse(weakHashtable.contains(new Long(2)));
  assertFalse(weakHashtable.contains(new Long(3)));
  assertTrue(weakHashtable.contains(new Long(100)));
  assertTrue(weakHashtable.contains(new Long(200)));
  assertTrue(weakHashtable.contains(new Long(300)));
  assertFalse(weakHashtable.contains(new Long(400)));
  }
  
  /** Tests public boolean containsKey(ObjectÊkey) */
  public void testContainsKey() throws Exception {
  assertTrue(weakHashtable.containsKey(new Long(1)));
  assertTrue(weakHashtable.containsKey(new Long(2)));
  assertTrue(weakHashtable.containsKey(new Long(3)));
  assertFalse(weakHashtable.containsKey(new Long(100)));
  assertFalse(weakHashtable.containsKey(new Long(200)));
  assertFalse(weakHashtable.containsKey(new Long(300)));
  assertFalse(weakHashtable.containsKey(new Long(400)));
  }
  
  /** Tests public boolean containsValue(ObjectÊvalue) */
  public void testContainsValue() throws Exception {
  assertFalse(weakHashtable.containsValue(new Long(1)));
  assertFalse(weakHashtable.containsValue(new Long(2)));
  assertFalse(weakHashtable.containsValue(new Long(3)));
  assertTrue(weakHashtable.containsValue(new Long(100)));
  assertTrue(weakHashtable.containsValue(new Long(200)));
  assertTrue(weakHashtable.containsValue(new Long(300)));
  assertFalse(weakHashtable.containsValue(new Long(400)));
  }
  
  /** Tests public Enumeration elements() */
  public void testElements() throws Exception {
  ArrayList elements = new ArrayList();
  for (Enumeration e = weakHashtable.elements(); e.hasMoreElements();) {
  elements.add(e.nextElement());
  }
  assertEquals(3, elements.size());
  assertTrue(elements.contains(valueOne));
  assertTrue(elements.contains(valueTwo));
  assertTrue(elements.contains(valueThree));
  }
  
  /** Tests public Set entrySet() */
  public void testEntrySet() throws Exception {
  Set entrySet = weakHashtable.entrySet();
  for (Iterator it = entrySet.iterator(); it.hasNext();) {
  Map.Entry entry = (Map.Entry) it.next();
  O

cvs commit: jakarta-commons/logging/optional/src/test/org/apache/commons/logging LogFactoryTest.java

2004-11-10 Thread rdonkin
rdonkin 2004/11/10 14:59:39

  Added:   logging/optional/src/test/org/apache/commons/logging
LogFactoryTest.java
  Log:
  LogFactory's Hashtable implementation (used to store LogFactoryImpl by 
classloader) can now be subclassed. This will default to WeakHashtable when 
this is present on the classpath, Hashtable otherwise. The implementation class 
can be specified by a system property. Based on a contribution by Brian 
Stansberry.
  
  Revision  ChangesPath
  1.1  
jakarta-commons/logging/optional/src/test/org/apache/commons/logging/LogFactoryTest.java
  
  Index: LogFactoryTest.java
  ===
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *  http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */ 
  
  
  package org.apache.commons.logging;
  
  import junit.framework.*;
  import java.util.*;
  import org.apache.commons.logging.impl.WeakHashtable;
  
  public class LogFactoryTest extends TestCase {
  
  
  /** Maximum number of iterations before our test fails */
  private static final int MAX_GC_ITERATIONS = 50;
  
  
  public LogFactoryTest(String testName) {
  super(testName);
  }
  
  public void testLogFactoryType() {
  assertTrue(LogFactory.factories instanceof WeakHashtable);
  }
  }
  
  
  

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



cvs commit: jakarta-commons/logging/optional/src/java/org/apache/commons/logging/impl WeakHashtable.java

2004-11-10 Thread rdonkin
rdonkin 2004/11/10 14:59:24

  Added:   logging/optional/src/java/org/apache/commons/logging/impl
WeakHashtable.java
  Log:
  LogFactory's Hashtable implementation (used to store LogFactoryImpl by 
classloader) can now be subclassed. This will default to WeakHashtable when 
this is present on the classpath, Hashtable otherwise. The implementation class 
can be specified by a system property. Based on a contribution by Brian 
Stansberry.
  
  Revision  ChangesPath
  1.1  
jakarta-commons/logging/optional/src/java/org/apache/commons/logging/impl/WeakHashtable.java
  
  Index: WeakHashtable.java
  ===
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *  http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */ 
  
  
  package org.apache.commons.logging.impl;
  
  import java.lang.ref.WeakReference;
  import java.util.*;
  
  /**
   * Implementation of Hashtable that uses 
WeakReference's
   * to hold it's keys thus allowing them to be reclaimed by the garbage 
collector.
   * 
   * 
   * Usage: typical use case is as a drop-in replacement 
   * for the Hashtable use in LogFactory for J2EE 
enviroments
   * running 1.3+ JVMs. Use of this class will allow classloaders to be 
collected by 
   * the garbage collector without the need to call release.
   * 
   */
  public final class WeakHashtable extends Hashtable {
  
  
  public WeakHashtable() {}
  
  /**
   [EMAIL PROTECTED] Hashtable
   */
  public boolean contains(Object value) {
  if (value instanceof Referenced) {
  return super.contains(value);
  }
  Referenced referenced = new Referenced(value);
  return super.contains(referenced);
  }
  
  /**
   [EMAIL PROTECTED] Hashtable
   */
  public boolean containsKey(Object key) {
  Referenced referenced = new Referenced(key);
  return super.containsKey(referenced);
  }
  
  /**
   [EMAIL PROTECTED] Hashtable
   */
  public boolean containsValue(Object value) {
  if (value instanceof Referenced) {
  return super.contains(value);
  }
  Referenced referenced = new Referenced(value);
  return super.containsValue(referenced);
  }
  
  /**
   [EMAIL PROTECTED] Hashtable
   */
  public Enumeration elements() {
  final Enumeration enum = super.elements();
  return new Enumeration() {
  public boolean hasMoreElements() {
  return enum.hasMoreElements();
  }
  public Object nextElement() {
   Referenced nextReference = (Referenced) enum.nextElement();
   return nextReference.getValue();
  }
  };
  }
  
  /**
   [EMAIL PROTECTED] Hashtable
   */
  public Set entrySet() {
  Set referencedEntries = super.entrySet();
  Set unreferencedEntries = new HashSet();
  for (Iterator it=referencedEntries.iterator(); it.hasNext();) {
  Map.Entry entry = (Map.Entry) it.next();
  Referenced referencedKey = (Referenced) entry.getKey();
  Object key = referencedKey.getValue();
  Referenced referencedValue = (Referenced) entry.getValue();
  Object value = referencedValue.getValue();
  if (key != null) {
  Entry dereferencedEntry = new Entry(key, value);
  unreferencedEntries.add(dereferencedEntry);
  }
  }
  return unreferencedEntries;
  }
  
  /**
   [EMAIL PROTECTED] Hashtable
   */
  public Object get(Object key) {
  Object result = null;
  Referenced referenceKey = new Referenced(key);
  Referenced referencedValue = (Referenced) super.get(referenceKey);
  if (referencedValue != null) {
  result = referencedValue.getValue();
  }
  return result;
  }
  
  /**
   [EMAIL PROTECTED] Hashtable
   */
  public Enumeration keys() {
  final Enumeration enum = super.keys();
  return new Enumeration() {
  public boolean hasMoreElements() {
  return enum.hasMoreElements();
  }
  public Object nextElement() {
   Referenced next

cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging LogFactory.java

2004-11-10 Thread rdonkin
rdonkin 2004/11/10 14:59:04

  Modified:logging  build.xml
   logging/optional/src/test/org/apache/commons/logging
TestAll.java
   logging/src/java/org/apache/commons/logging LogFactory.java
  Log:
  LogFactory's Hashtable implementation (used to store LogFactoryImpl by 
classloader) can now be subclassed. This will default to WeakHashtable when 
this is present on the classpath, Hashtable otherwise. The implementation class 
can be specified by a system property. Based on a contribution by Brian 
Stansberry.
  
  Revision  ChangesPath
  1.48  +24 -2 jakarta-commons/logging/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-commons/logging/build.xml,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- build.xml 4 Nov 2004 22:59:02 -   1.47
  +++ build.xml 10 Nov 2004 22:59:04 -  1.48
  @@ -462,7 +462,7 @@
   
   
 
 
   
  +
  +
  +  
  +
  +
  +
  +  
  +  
  +  
  +
  +
  +
  +
  +  
  +  
  +  
  +
  +
  +  
   
   
  
  
  
  1.2   +4 -1  
jakarta-commons/logging/optional/src/test/org/apache/commons/logging/TestAll.java
  
  Index: TestAll.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/logging/optional/src/test/org/apache/commons/logging/TestAll.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestAll.java  4 Nov 2004 23:03:59 -   1.1
  +++ TestAll.java  10 Nov 2004 22:59:04 -  1.2
  @@ -19,6 +19,7 @@
   
   import junit.framework.*;
   import org.apache.commons.logging.impl.MemoryLogTest;
  +import org.apache.commons.logging.impl.WeakHashtableTest;
   
   /**
 *  The build script calls just one TestSuite - this one!
  @@ -38,6 +39,8 @@
   TestSuite suite = new TestSuite();
   
   suite.addTest(MemoryLogTest.suite());
  +suite.addTestSuite(WeakHashtableTest.class);
  +suite.addTestSuite(LogFactoryTest.class);
   
   return suite;
   }
  
  
  
  1.28  +59 -2 
jakarta-commons/logging/src/java/org/apache/commons/logging/LogFactory.java
  
  Index: LogFactory.java
  ===
  RCS file: 
/home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/LogFactory.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- LogFactory.java   6 Jun 2004 21:15:12 -   1.27
  +++ LogFactory.java   10 Nov 2004 22:59:04 -  1.28
  @@ -79,6 +79,42 @@
   protected static final String SERVICE_ID =
   "META-INF/services/org.apache.commons.logging.LogFactory";
   
  +/**
  + * Setting this system property value allows the 
Hashtable used to store
  + * classloaders to be substituted by an alternative implementation.
  + * 
  + * 
  + * Note: LogFactory will print:
  + * 
  + * [ERROR] LogFactory: Load of custom hashtable failed
  + * 
  + * to system error and then continue using a standard Hashtable.
  + * 
  + * 
  + * Usage: Set this property when Java is invoked
  + * and LogFactory will attempt to load a new instance 
  + * of the given implementation class.
  + * For example, running the following ant scriplet:
  + * 
  + *  
  + * ...
  + * 
  + *  
  + * 
  + * will mean that LogFactory will load an instance of
  + * org.apache.commons.logging.AltHashtable.
  + * 
  + * 
  + * A typical use case is to allow a custom
  + * Hashtable implementation using weak references to be substituted.
  + * This will allow classloaders to be garbage collected without
  + * the need to release them (on 1.3+ JVMs only, of course ;)
  + * 
  + */
  +public static final String HASHTABLE_IMPLEMENTATION_PROPERTY =
  +"org.apache.commons.logging.LogFactory.HashtableImpl";
   
   // --- 
Constructors
   
  @@ -181,7 +217,28 @@
* The previously constructed LogFactory instances, keyed by
* the ClassLoader with which it was created.
*/
  -protected static Hashtable factories = new Hashtable();
  +protected static Hashtable factories = createFactoryStore();
  +
  +private static final Hashtable createFactoryStore() {
  +Hashtable result = null;
  +String storeImplementationClass 
  += System.getProperty(HASHTABLE_IMPLEMENTATION_PROPERTY);
  +   

Re: [convert] Type Conversion Library

2004-11-10 Thread robert burrell donkin
On 10 Nov 2004, at 22:46, Stephen Colebourne wrote:
This is a legal question, and most of us aren't very good at those ;-(
I believe that if your new work is derived directly from the original 
source
you gave to the ASF, and is not derived from any later additions made 
whilst
part of [convert], then the code is still just yours to do as your 
wish. But
IANAL.
this is also my understanding (again, though, IANAL). if this isn't 
good enough for you, then probably general at jakarta would be a better 
place to raise this issue. maybe a member or henri will be able to give 
you a more definitive answer...

of course, the derived contributions are also be built on providing 
that you abide by the terms of the ASL2.0 (which aren't very onerous).

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


Re: [convert] Type Conversion Library

2004-11-10 Thread Stephen Colebourne
This is a legal question, and most of us aren't very good at those ;-(

I believe that if your new work is derived directly from the original source
you gave to the ASF, and is not derived from any later additions made whilst
part of [convert], then the code is still just yours to do as your wish. But
IANAL.

Stephen


- Original Message -
From: "Ron Blaschke" <[EMAIL PROTECTED]>
> Some time ago, I came to this group with a proposal for a generic type
> conversion library.  As a refresher, it is a graph based solution,
> where you just drop in your converters and the library will try to
> figure out a possible path.
>
> Some example conversions that are working include
>   - String -> Integer (via String -> Long -> Integer path)
>   - u[] -> v[], given the library knows how to convert u -> v (eg, you
>   can simple say
> final byte[] bytes = converter.convert(new int[]{1,2,3},
Types.findType("byte[]"));
>
>   - u[] -> List, given the library knows how to convert u -> v
>
> The library's primary goal is to be generic.  Quite useful for rapid
> prototyping, or generic conversion (when you don't quite know the input
> or output type).
>
> Since you guys weren't too eager on my initial proposal, I don't
> expect that you are now - which is ok, really.
>
> But the library may or may not contain thoughts from our initial
> discussion, so I'd like to make sure that it is ok that I publish the
> library at my discretion.
>
> Thanks,
> Ron
>
>
>
>
> -
> 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: [convert] Type Conversion Library

2004-11-10 Thread Ron Blaschke
Wednesday, November 10, 2004, 8:15:51 PM, Kris Nuttycombe wrote:
> I'm certainly interested in type conversion problems. Are you working
> with the existing commons-convert project in the sandbox?

No, it's something different that currently just lives on my hard
disk.  The code is somewhat messy, and may be of little use for
others right now.  But I'm about to start working on the
documentation.

The approach is nothing really fancy.  It contains a simple type
system, to model primitives, classes and parametric types, a graph to
"draw" the conversions and a lookup (currently Dijkstra's shortest
path algorithm) to find a conversion path.

Once I've got the basic documentation in place I'll put it up
somewhere, and gladly drop you a note.

Ron



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



Re: [all] (reprise) links to books (and similar resources)

2004-11-10 Thread robert burrell donkin
On 10 Nov 2004, at 21:44, Shapira, Yoav wrote:
Hi,
the reason why the consensus moved from direct linking from a
resources
page on the site was that it might appear too much like an official
recommendation which may cause frictions within the community.
FWIW, although I wasn't involved in this discussion (and certainly was
not part of "the consensus"), I disagree with the above.  As long as a
resources page clarifies that no endorsement or preference is being
made, and the same page is open to / inclusive of all relevant works, I
think that's fine.  It's like the vendors page off the Jakarta home
page.
If everyone else thinks otherwise, that's fine, but just know that if
such a consensus exists, it's at best limited to commons only, and does
not apply to Jakarta in general (and other Apache TLPs).
at the time, struts was going through a tough time working out what to 
do when some committers very strongly objected to the listing of some 
books. the jakarta vendor page has also proved very difficult. a 
document in cvs means has to be actively maintained by volunteers and 
the content approved (passively or actively). it can be argued that 
listing on an ASF page is a form of endorsement (and there's a general 
wariness about endorsements amongst some...).

after long (and often painful) experience with the jakarta vendor page, 
i (for one) would not volunteer to create or maintain a page for books, 
so i'm probably -0 on including a page in the documentation.

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


DO NOT REPLY [Bug 29203] - Indexed properties with Array type cause IllegalArgumentException in setProperty/populate

2004-11-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29203

Indexed properties with Array type cause IllegalArgumentException in 
setProperty/populate

[EMAIL PROTECTED] changed:

   What|Removed |Added

   Severity|Minor   |Normal

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



RE: [all] (reprise) links to books (and similar resources)

2004-11-10 Thread Shapira, Yoav

Hi,

>> the reason why the consensus moved from direct linking from a
resources
>> page on the site was that it might appear too much like an official
>> recommendation which may cause frictions within the community.

FWIW, although I wasn't involved in this discussion (and certainly was
not part of "the consensus"), I disagree with the above.  As long as a
resources page clarifies that no endorsement or preference is being
made, and the same page is open to / inclusive of all relevant works, I
think that's fine.  It's like the vendors page off the Jakarta home
page.

If everyone else thinks otherwise, that's fine, but just know that if
such a consensus exists, it's at best limited to commons only, and does
not apply to Jakarta in general (and other Apache TLPs).

>> 1. use the wiki

Yup, the wiki is fine too.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



Re: [all] (reprise) links to books (and similar resources)

2004-11-10 Thread Martin Cooper
On Wed, 10 Nov 2004 20:37:27 +, robert burrell donkin
<[EMAIL PROTECTED]> wrote:
> a while we talked about the right way to tell users about books and so
> on. IIRC henri volunteered to create an offshore sourceforge
> documentation project (but i can't find it link anywhere). recently,
> the question 'are there books covering digester?' has arising on the
> user list so there still seems to be a genuine need. might be a good
> time to think about addressing it :)
> 
> the reason why the consensus moved from direct linking from a resources
> page on the site was that it might appear too much like an official
> recommendation which may cause frictions within the community.
> 
> there are a couple of alternatives to this (which spring to my mind):
> 
> 1. use the wiki

+1

--
Martin Cooper


> 2. revive the idea of an offshore documentation project (probably at
> sourceforge)
> 
> opinions?
> 
> - 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]



[all] (reprise) links to books (and similar resources)

2004-11-10 Thread robert burrell donkin
a while we talked about the right way to tell users about books and so 
on. IIRC henri volunteered to create an offshore sourceforge 
documentation project (but i can't find it link anywhere). recently, 
the question 'are there books covering digester?' has arising on the 
user list so there still seems to be a genuine need. might be a good 
time to think about addressing it :)

the reason why the consensus moved from direct linking from a resources 
page on the site was that it might appear too much like an official 
recommendation which may cause frictions within the community.

there are a couple of alternatives to this (which spring to my mind):
1. use the wiki
2. revive the idea of an offshore documentation project (probably at 
sourceforge)

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


Re: [convert] Type Conversion Library

2004-11-10 Thread Kris Nuttycombe
I'm certainly interested in type conversion problems. Are you working 
with the existing commons-convert project in the sandbox?

Kris
Ron Blaschke wrote:
Some time ago, I came to this group with a proposal for a generic type
conversion library.  As a refresher, it is a graph based solution,
where you just drop in your converters and the library will try to
figure out a possible path.
Some example conversions that are working include
 - String -> Integer (via String -> Long -> Integer path)
 - u[] -> v[], given the library knows how to convert u -> v (eg, you
 can simple say
final byte[] bytes = converter.convert(new int[]{1,2,3}, 
Types.findType("byte[]"));
 - u[] -> List, given the library knows how to convert u -> v
The library's primary goal is to be generic.  Quite useful for rapid
prototyping, or generic conversion (when you don't quite know the input
or output type).
Since you guys weren't too eager on my initial proposal, I don't
expect that you are now - which is ok, really.
But the library may or may not contain thoughts from our initial
discussion, so I'd like to make sure that it is ok that I publish the
library at my discretion.
Thanks,
Ron

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

--
=
Kris Nuttycombe
Associate Scientist
Geospatial Data Services Group
CIRES, National Geophysical Data Center/NOAA
(303) 497-6337
[EMAIL PROTECTED]
=

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


DO NOT REPLY [Bug 32145] - use a secure delete if the file is written to the disk

2004-11-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32145

use a secure delete if the file is written to the disk





--- Additional Comments From [EMAIL PROTECTED]  2004-11-10 18:28 ---
martin, I certainly agree that what I propose is not the perfect solution.
But I contend it to be without much burden on anyone (e.g. consumption of
processing power) "a lot more secure by default".

A lot of people get commons-fileupload.jar as part of struts or another package
and never bother to even read any documentation about it.
Your recommendation about even higher security achievable is certainly a good
one, but as long http://jakarta.apache.org/commons/fileupload/customizing.html
is rather empty, certainly only VERY FEW people are doing it.

So, an exposure during processing time of a few (milli)seconds as opposed to
months of residing on a disk and possibly even being found during disposal by
totally unrelated third parties IS a difference.
Agreed, quite some disclaimers would have to go with it, but I think for the
little cost it incurs, it is a first step in the right direction worthwhile to
take. (at least offer it as a configurable option)

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



DO NOT REPLY [Bug 32145] - use a secure delete if the file is written to the disk

2004-11-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32145

use a secure delete if the file is written to the disk





--- Additional Comments From [EMAIL PROTECTED]  2004-11-10 18:09 ---
People who care about security as you describe would be much better off not 
writing to the file system in the first place, or encrypting the files as they 
are written to disk. Either of these can be accomplished by implementing a 
custom FileItemFactory.

Using a secure deletion mechanism still leaves the file wide open on the disk 
for the duration of its processing. That would be a half-hearted approach to 
security at best. Wouldn't implementing such a mechanism be more likely to lull 
people into a false sense of security?

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



DO NOT REPLY [Bug 32162] New: - Call to toString() in should be replaced with getConvertUtils().convert(value)

2004-11-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32162

Call to toString() in should be replaced with getConvertUtils().convert(value)

   Summary: Call to toString() in should be replaced with
getConvertUtils().convert(value)
   Product: Commons
   Version: Nightly Builds
  Platform: Other
OS/Version: Other
Status: NEW
  Severity: Normal
  Priority: Other
 Component: Bean Utilities
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


In BeanUtilsBean#getArrayProperty(Object, String) line 577 (in the CVS version),
we should have:

  results[0] = getConvertUtils().convert(value);

instead of:

  results[0] = value.toString();

Rationale: the struts html taglibs doesn't work correctly with my objects with
the  correct Converters registered.

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



DO NOT REPLY [Bug 27523] - [daemon] Can not compile under Fedora Core 1 AMD64

2004-11-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27523

[daemon] Can not compile under Fedora Core 1 AMD64





--- Additional Comments From [EMAIL PROTECTED]  2004-11-10 16:44 ---
The latest nightly source snapshot does not configure on an Opteron box running

Linux phoenix 2.6.9-gentoo-r1 #2 SMP Wed Oct 27 15:37:43 EDT 2004 x86_64 AMD 
Opteron(tm) 
Processor 246 AuthenticAMD GNU/Linux

The patch I just attached fixes this: the resulting binary works to launch 
Tomcat, at least for me.

I expect changes are required to location.c because the Blackdown JDK 1.4.x 
distribution for AMD64 
has a layout different from those I see in that file. However, if JAVA_HOME is 
set it appears to work 
anyway.

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



DO NOT REPLY [Bug 27523] - [daemon] Can not compile under Fedora Core 1 AMD64

2004-11-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27523

[daemon] Can not compile under Fedora Core 1 AMD64





--- Additional Comments From [EMAIL PROTECTED]  2004-11-10 16:40 ---
Created an attachment (id=13383)
Patch to apsupport.m4 to support AMD64

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



cvs commit: jakarta-commons-sandbox/sql/src/java/org/apache/commons/sql/io JdbcModelReader.java

2004-11-10 Thread mvdb
mvdb2004/11/10 07:21:53

  Modified:sql/src/java/org/apache/commons/sql/io JdbcModelReader.java
  Log:
  Setting the tabletype
  
  Revision  ChangesPath
  1.9   +1 -0  
jakarta-commons-sandbox/sql/src/java/org/apache/commons/sql/io/JdbcModelReader.java
  
  Index: JdbcModelReader.java
  ===
  RCS file: 
/home/cvs/jakarta-commons-sandbox/sql/src/java/org/apache/commons/sql/io/JdbcModelReader.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JdbcModelReader.java  14 Oct 2004 19:42:48 -  1.8
  +++ JdbcModelReader.java  10 Nov 2004 15:21:53 -  1.9
  @@ -160,6 +160,7 @@
   : null;
   Table t1 = new Table();
   t1.setName(tableName);
  +t1.setType(tableType);
   tables.add(t1);
   }
   
  
  
  

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



DO NOT REPLY [Bug 32152] New: - Problem calculating total article count

2004-11-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32152

Problem calculating total article count

   Summary: Problem calculating total article count
   Product: Commons
   Version: 1.2 Final
  Platform: All
OS/Version: All
Status: NEW
  Severity: Normal
  Priority: Other
 Component: Net
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


I am using Commons Net 1.2.2

When you ask for the list of newsgroups of a NNTP Server, the framework doesn't
calculate correctly the total article count when that specific newsgroup has no
articles.

For example, the NNTP Server answers something like this:

  org.javahispano.j2ee 0 0 y

then, debugging the source code of class:

  org.apache.commons.net.nntp.NNTPClient

I found the problem in method:

  private NewsgroupInfo __parseNewsgroupListEntry(String entry)

where it does:

  ...
  result._setNewsgroup(tokenizer.nextToken());
  last = tokenizer.nextToken();
  first = tokenizer.nextToken();
  permission = tokenizer.nextToken();

  try
  {
lastNum = Integer.parseInt(last);
firstNum = Integer.parseInt(first);
result._setFirstArticle(firstNum);
result._setLastArticle(lastNum);
result._setArticleCount(lastNum - firstNum + 1);
  }
  catch (NumberFormatException e)
  {
return null;
  }

The proble is in this line:

  result._setArticleCount(lastNum - firstNum + 1);

where if lastNum is 0 and firstNum is 0, it sais that the newsgroup has 1
article. I understand the code should add a control line where it double check
if lastNum and firstNum are 0. Right?

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



RE: [math][vote] Release 1.0-RC2

2004-11-10 Thread Shapira, Yoav

Hi,
+1 from me, apologizing for the delay.  It's been busy in Tomcat land ;)

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: Brent Worden [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, November 09, 2004 7:52 PM
>To: 'Jakarta Commons Developers List'
>Subject: RE: [math][vote] Release 1.0-RC2
>
>+1
>
>Brent Worden
>
>> -Original Message-
>> From: Phil Steitz [mailto:[EMAIL PROTECTED]
>> Sent: Sunday, November 07, 2004 7:07 PM
>> To: Jakarta Commons Developers List
>> Subject: [math][vote] Release 1.0-RC2
>>
>> This vote is to approve the public release of commons math
>> 1.0-RC2. This release candidate incorporates community
>> feedback on RC1. Like RC1, this will be a publicly announced
>> RC to enable full feedback for a final 1.0 release in about
>> two weeks if all is well.
>>
>> A complete list of changes since RC1 is available here:
>> http://www.apache.org/~psteitz/commons-math-1.0-RC2/docs/chang
>es-report.html
>>
>> The release candidate distribution files are here:
>> http://www.apache.org/~psteitz/commons-math-1.0-RC2/dist/
>>
>> The updated web site is available here:
>> http://www.apache.org/~psteitz/commons-math-1.0-RC2/docs/
>>
>> Voting will last at least 72 hours. As always, it would be
>> useful if others could check the md5 checksums and asc signatures.
>>
>> Thanks,
>>
>> 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]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



DO NOT REPLY [Bug 30973] - [email] [patch] HTML email with plain text alternative and attachments

2004-11-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30973

[email] [patch] HTML email with plain text alternative and attachments





--- Additional Comments From [EMAIL PROTECTED]  2004-11-10 12:46 ---
Created an attachment (id=13379)
resubmission of previous patches with minor changes (thanks to directions from 
scott)

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



DO NOT REPLY [Bug 30973] - [email] [patch] HTML email with plain text alternative and attachments

2004-11-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30973

[email] [patch] HTML email with plain text alternative and attachments





--- Additional Comments From [EMAIL PROTECTED]  2004-11-10 12:45 ---
Scott (all),

Thanks for you help and patience with this matter. 
I am happy to say that I believe that I have finally got it licked once and 
for all.

Please let me know how is goes for you.
-Corey

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



[convert] Type Conversion Library

2004-11-10 Thread Ron Blaschke
Some time ago, I came to this group with a proposal for a generic type
conversion library.  As a refresher, it is a graph based solution,
where you just drop in your converters and the library will try to
figure out a possible path.

Some example conversions that are working include
  - String -> Integer (via String -> Long -> Integer path)
  - u[] -> v[], given the library knows how to convert u -> v (eg, you
  can simple say
final byte[] bytes = converter.convert(new int[]{1,2,3}, 
Types.findType("byte[]"));

  - u[] -> List, given the library knows how to convert u -> v

The library's primary goal is to be generic.  Quite useful for rapid
prototyping, or generic conversion (when you don't quite know the input
or output type).

Since you guys weren't too eager on my initial proposal, I don't
expect that you are now - which is ok, really.

But the library may or may not contain thoughts from our initial
discussion, so I'd like to make sure that it is ok that I publish the
library at my discretion.

Thanks,
Ron




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