Re: [lang] ***Utils.classForName( String) ?
Ola Berg wrote: Is the ClassUtils supposed to go into [lang]? If then, yes, if not... I (like java.lang) think that loading class per name is really core. Maybe this ClassUtils will do the same as: http://jakarta.apache.org/commons/discover/apidocs/org/apache/commons/discovery/load/ClassLoaderUtils.html ? Tomek As for better and best... different algorithms in different methods, plus a recommended method that points to any of the former? /O -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [lang] ***Utils.classForName( String) ?
Maybe this ClassUtils will do the same as: http://jakarta.apache.org/commons/discover/apidocs/org/apache/commons/discovery/load/ClassLoaderUtils.html ? Not only, no. But for the class loading parts more or less yes. There is a slight overlap in functionality here. What the regular [lang] user needs is a quick replacement for Class.forName() that can be considered safe to use. /O -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[GUMP] Build Failure - commons-email
This email is autogenerated from the output from: http://cvs.apache.org/builds/gump/2002-11-29/commons-email.html Buildfile: build-gump.xml jar: [mkdir] Created dir: /home/rubys/jakarta/jakarta-commons-sandbox/email/target/classes [javac] Compiling 7 source files to /home/rubys/jakarta/jakarta-commons-sandbox/email/target/classes [javac] /home/rubys/jakarta/jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/HtmlEmail.java:66: cannot resolve symbol [javac] symbol : class GenerateUniqueId [javac] location: package util [javac] import org.apache.commons.util.GenerateUniqueId; [javac]^ [javac] /home/rubys/jakarta/jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/HtmlEmail.java:208: cannot resolve symbol [javac] symbol : class GenerateUniqueId [javac] location: package util [javac] String cid = org.apache.commons.util.GenerateUniqueId.getIdentifier(); [javac] ^ [javac] 2 errors BUILD FAILED file:///home/rubys/jakarta/jakarta-commons-sandbox/email/build-gump.xml:22: Compile failed; see the compiler error output for details. Total time: 5 seconds -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[GUMP] Build Failure - commons-jelly
This email is autogenerated from the output from: http://cvs.apache.org/builds/gump/2002-11-29/commons-jelly.html Buildfile: build.xml init: [mkdir] Created dir: /home/rubys/jakarta/jakarta-commons-sandbox/jelly/lib get-deps: compile: [mkdir] Created dir: /home/rubys/jakarta/jakarta-commons-sandbox/jelly/target/classes [javac] Compiling 340 source files to /home/rubys/jakarta/jakarta-commons-sandbox/jelly/target/classes [javac] /home/rubys/jakarta/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/xmlunit/AssertDocumentsEqualTag.java:61: package org.custommonkey.xmlunit does not exist [javac] import org.custommonkey.xmlunit.Diff; [javac] ^ [javac] /home/rubys/jakarta/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/xmlunit/AssertDocumentsEqualTag.java:62: package org.custommonkey.xmlunit does not exist [javac] import org.custommonkey.xmlunit.XMLUnit; [javac] ^ [javac] /home/rubys/jakarta/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/xmlunit/AssertDocumentsEqualTag.java:111: cannot resolve symbol [javac] symbol : variable XMLUnit [javac] location: class org.apache.commons.jelly.tags.xmlunit.AssertDocumentsEqualTag [javac] XMLUnit.setIgnoreWhitespace(ignoreWhitespace); [javac] ^ [javac] /home/rubys/jakarta/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/xmlunit/AssertDocumentsEqualTag.java:112: cannot resolve symbol [javac] symbol : class Diff [javac] location: class org.apache.commons.jelly.tags.xmlunit.AssertDocumentsEqualTag [javac] Diff delta = [javac] ^ [javac] /home/rubys/jakarta/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/xmlunit/AssertDocumentsEqualTag.java:113: cannot resolve symbol [javac] symbol : variable XMLUnit [javac] location: class org.apache.commons.jelly.tags.xmlunit.AssertDocumentsEqualTag [javac] XMLUnit.compare( [javac] ^ [javac] /home/rubys/jakarta/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/task/JellyTask.java:80: warning: project in org.apache.tools.ant.ProjectComponent has been deprecated [javac] context.setVariable( project, project ); [javac] ^ [javac] /home/rubys/jakarta/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/task/JellyTask.java:85: warning: location in org.apache.tools.ant.Task has been deprecated [javac] throw new BuildException(e, location); [javac] ^ [javac] /home/rubys/jakarta/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/task/JellyTask.java:166: warning: project in org.apache.tools.ant.ProjectComponent has been deprecated [javac] context = new AntJellyContext(project, parentContext); [javac] ^ [javac] /home/rubys/jakarta/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/task/JellyTask.java:196: warning: project in org.apache.tools.ant.ProjectComponent has been deprecated [javac] File file = project.resolveFile(name); [javac] ^ [javac] 5 errors [javac] 4 warnings BUILD FAILED file:///home/rubys/jakarta/jakarta-commons-sandbox/jelly/build.xml:34: Compile failed; see the compiler error output for details. Total time: 13 seconds -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/core TestInvokeTag.java testInvokeTag.jelly
rwaldhoff2002/11/29 07:53:10 Modified:jelly/src/java/org/apache/commons/jelly/tags/core CoreTagLibrary.java Added: jelly/src/java/org/apache/commons/jelly/tags/core InvokeTag.java jelly/src/test/org/apache/commons/jelly/core TestInvokeTag.java testInvokeTag.jelly Log: add invoke tag and tests Revision ChangesPath 1.24 +10 -9 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/CoreTagLibrary.java Index: CoreTagLibrary.java === RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/CoreTagLibrary.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- CoreTagLibrary.java 28 Nov 2002 00:22:23 - 1.23 +++ CoreTagLibrary.java 29 Nov 2002 15:53:10 - 1.24 @@ -104,17 +104,18 @@ registerTag(import, ImportTag.class); // extensions to JSTL +registerTag(arg, ArgTag.class); registerTag(break, BreakTag.class); registerTag(expr, ExprTag.class); +registerTag(file, FileTag.class); +registerTag(invoke, InvokeTag.class); registerTag(new, NewTag.class); -registerTag(arg, ArgTag.class); +registerTag(scope, ScopeTag.class); registerTag(setProperties, SetPropertiesTag.class); +registerTag(thread, ThreadTag.class); registerTag(useBean, UseBeanTag.class); registerTag(useList, UseListTag.class); registerTag(whitespace, WhitespaceTag.class); -registerTag(thread, ThreadTag.class); -registerTag(file, FileTag.class); -registerTag(scope, ScopeTag.class); } } 1.1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/InvokeTag.java Index: InvokeTag.java === /* * $Header: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/InvokeTag.java,v 1.1 2002/11/29 15:53:10 rwaldhoff Exp $ * $Revision: 1.1 $ * $Date: 2002/11/29 15:53:10 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 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 *
cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core NewTag.java
rwaldhoff2002/11/29 08:06:25 Removed: jelly/src/java/org/apache/commons/jelly/tags/core NewTag.java Log: remove (about to attempt re-add without -ko option) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core NewTag.java
rwaldhoff2002/11/29 08:07:08 Added: jelly/src/java/org/apache/commons/jelly/tags/core NewTag.java Log: re-add (trying to remove -ko option) Revision ChangesPath 1.5 +5 -5 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/NewTag.java -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database DatabaseContentHandler.java DriverProtocol.java
prickett2002/11/29 08:53:29 Added: periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database DatabaseContentHandler.java DriverProtocol.java Log: Added a first cut of the Database Content Handler java file Added a first cut of the Driver Protocol java file Revision ChangesPath 1.1 jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DatabaseContentHandler.java Index: DatabaseContentHandler.java === package org.apache.commons.periodicity.database; /* * $Header: /home/cvs/jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DatabaseContentHandler.java,v 1.1 2002/11/29 16:53:28 prickett Exp $ * $Revision: 1.1 $ * $Date: 2002/11/29 16:53:28 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 2000-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/. * */ import java.util.Map; import java.util.Hashtable; import java.util.Set; import java.util.HashSet; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; import org.apache.log4j.Logger; import org.apache.log4j.LogManager; import org.apache.commons.periodicity.util.JUnitUtils; public class DatabaseContentHandler extends DefaultHandler { /** The qualified name of the databases element */ public static final String DATABASES_ELEMENT_QNAME = databases; /** The qualified name of the driver element */ public static final String DATABASE_ELEMENT_QNAME = database; /** The qualified name of the short description element */ public static final String SHORT_DESC_QNAME = short-description; /** The qualified name of the description element */ public static final String DESCRIPTION_QNAME = description; /** The qualified name of the web url element */ public static final String WEB_URL_QNAME = web-url; /** The qualified name of the name attribute for databases and protocols */ public static final String NAME_QNAME_ATTRIBUTE = name; /** The qualified name of the administration path
cvs commit: jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database DriverProtocolNullValueTests.java DriverProtocolSetGetTests.java DriverProtocolTestSuite.java
prickett2002/11/29 09:49:43 Added: periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database DriverProtocolNullValueTests.java DriverProtocolSetGetTests.java DriverProtocolTestSuite.java Log: Added Driver Protocol test suite and supporting tests. Revision ChangesPath 1.1 jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database/DriverProtocolNullValueTests.java Index: DriverProtocolNullValueTests.java === package org.apache.commons.periodicity.database; /* * $Header: /home/cvs/jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database/DriverProtocolNullValueTests.java,v 1.1 2002/11/29 17:49:43 prickett Exp $ * $Revision: 1.1 $ * $Date: 2002/11/29 17:49:43 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 2000-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/. * */ import junit.framework.Test; import org.apache.commons.periodicity.junit.TestWithMavenLogging; public class DriverProtocolNullValueTests extends TestWithMavenLogging { public static final String TEST_NAME = DriverProtocol.null_tests; public static final String VALID_NAME = valid_name; public static final String VALID_SCHEME = jdbc:valid:scheme; public DriverProtocolNullValueTests() { super(TEST_NAME); } protected void runTest() { try { DriverProtocol dp = new DriverProtocol(null, null); fail(DriverProtocol constructor with two null arguments + should throw an exception.); } catch(Exception e) { if(getLogger() != null) { getLogger().info(Expected Exception, e); } } try { DriverProtocol dp = new DriverProtocol(VALID_NAME, null); fail(DriverProtocol constructor with null scheme + should throw an exception.); } catch(Exception e) {
cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient TestCookie.java
jsdever 2002/11/29 11:03:02 Modified:httpclient/src/java/org/apache/commons/httpclient Cookie.java httpclient/src/test/org/apache/commons/httpclient TestCookie.java Log: Make version 2 cookies the default. Changes: 1) This patch fixes the problem of Cookie class assuming Netscape cookie format per default. With this fix RFC 2109 compliant validation applies unless the cookie version is explicitly set to 0 (Netscape cookie draft) 2) I have also taken liberty in heavily refactoring the Cookie.parse() method - I have tried to restructure the code by separating parsing and validation processes. The code is a bit more modular now - I have improved (or so I'd like to hope) exception handling and logging, which was next to awful, at least in my humble opinion. Stuff should be more consistent now - The code should have gotten somewhat cleaner. (Code clarity is a subjective matter, though, so critique is always welcome) Contributed by: Oleg Kalnichevski Revision ChangesPath 1.27 +235 -221 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Cookie.java Index: Cookie.java === RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Cookie.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- Cookie.java 28 Nov 2002 00:21:14 - 1.26 +++ Cookie.java 29 Nov 2002 19:03:02 - 1.27 @@ -791,257 +791,271 @@ /* Build the default path. Per RFC 2109/4.3.1 this is the * request path up to, but not including, the right-most / charater. */ -if(path.length() == 0){ -log.debug(Cookie.parse(): Fixing up empty request path.); +if (path.length() == 0) { +log.debug(Fixing up empty request path.); path = PATH_DELIM; } String defaultPath = null; int lastSlashIndex = path.lastIndexOf(PATH_DELIM); if(lastSlashIndex == 0){ defaultPath = PATH_DELIM; -}else if(lastSlashIndex 0){ +} +else if(lastSlashIndex 0) { defaultPath = path.substring(0, lastSlashIndex); -}else{ +} +else { defaultPath = path; } -HeaderElement[] headerElements = -HeaderElement.parse(setCookie.getValue()); - -Cookie[] cookies = new Cookie[headerElements.length]; -int index = 0; -for (int i = 0; i headerElements.length; i++) { - -Cookie cookie = new Cookie(domain, - headerElements[i].getName(), - headerElements[i].getValue(), - defaultPath, - null, - false); - -// cycle through the parameters -NameValuePair[] parameters = headerElements[i].getParameters(); -// could be null. In case only a header element and no parameters. -if (parameters != null) { -boolean discard_set = false, secure_set = false; -for (int j = 0; j parameters.length; j++) { -String name = parameters[j].getName().toLowerCase(); - -// check for required value parts -if ( (name.equals(version) || name.equals(max-age) || - name.equals(domain) || name.equals(path) || - name.equals(comment) || name.equals(expires)) - parameters[j].getValue() == null) { -if(log.isDebugEnabled()) { -log.debug(Cookie.parse(): Unable to parse set-cookie header \ + setCookie.getValue() + \ because \ + parameters[j].getName() + \ requires a value in cookie \ + headerElements[i].getName() + \.); -} -throw new HttpException( -Bad Set-Cookie header: + setCookie.getValue() + -\nMissing value for + -parameters[j].getName() + - attribute in cookie ' + -headerElements[i].getName() + '); -} - -if (name.equals(version)) { -try { - cookie.setVersion( - Integer.parseInt(parameters[j].getValue())); -} catch (NumberFormatException nfe) { -if(log.isDebugEnabled()) { -log.debug(Cookie.parse(): Exception
DO NOT REPLY [Bug 14970] New: - Passing null for factory causes NullPointerException
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=14970. 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=14970 Passing null for factory causes NullPointerException Summary: Passing null for factory causes NullPointerException Product: Commons Version: 1.0.1 Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: Pool AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] According to documentation of GenericObjectPool and StackObjectPool, it should be possible to add Objects to the pool manually rather than via a factory. This doesn't work because the implementations don't allow factory to be null. Also, returnObject() shouldn't be used for this purpose. A new method on the ObjectPool interface, addNewObject(), is required for this purpose. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DO NOT REPLY [Bug 14970] - Passing null for factory causes NullPointerException
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=14970. 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=14970 Passing null for factory causes NullPointerException --- Additional Comments From [EMAIL PROTECTED] 2002-11-29 20:22 --- Really two issues here: 1. the abstract ObjectPool interface is missing a method for manual addition of new Objects. this is distinct from returnObject(). this is a design issue. 2. existing implementations claim that factory can be set to null, but do not in fact allow this, they throw NullPointerException. this is just a bug or bugs. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database DriverMDNullValueTests.java DriverMDProtocolsTests.java DriverProtocolNullValueTests.java
prickett2002/11/29 16:43:24 Modified: periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database DriverContentHandler.java DriverMetaData.java DriverMetaDataImpl.java DriverProtocol.java periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database DriverMDNullValueTests.java DriverMDProtocolsTests.java DriverProtocolNullValueTests.java Log: Moved processing of url tag and admin-url from the database handler to the driver handler. Moved DEFAULT_PROTOCOL_NAME from DriverMetaData to DriverProtocol. Fixed the protocol processing in DriverMetaDataImpl to use DriverProtocol Fixed the DriverProtocol constructor to set the default protocol name if newName is null. Fixed the test suite to reflect changes due to the new Driver Protocol class. Revision ChangesPath 1.8 +30 -4 jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DriverContentHandler.java Index: DriverContentHandler.java === RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DriverContentHandler.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- DriverContentHandler.java 29 Nov 2002 03:32:28 - 1.7 +++ DriverContentHandler.java 30 Nov 2002 00:43:23 - 1.8 @@ -98,6 +98,12 @@ /** The qualified name of the url scheme element */ public static final String SCHEME_QNAME = scheme; +/** The qualified name of the url element */ +public static final String URL_QNAME = url; + +/** The qualified name of the admin url element */ +public static final String ADMIN_URL_QNAME = admin-url; + /** The qualified name of the protocol element */ public static final String PROTOCOL_ELEMENT_QNAME = protocol; @@ -117,6 +123,12 @@ /** A variable to hold the protocol name for the current protocol */ private String protocolName = null; +/** A variable to hold the protocol url for the current protocol */ +private String protocolUrl = null; + +/** A variable to hold the protocol administration url */ +private String protocolAdminUrl = null; + /** A variable to hold the protocols for the current driver */ private Map protocols = null; @@ -206,12 +218,26 @@ if(lookForDrivers qName != null qName.equals(PROTOCOL_ELEMENT_QNAME)) { -driverMeta.addProtocol(protocolName, scheme); +DriverProtocol protocol = new DriverProtocol(protocolName, + scheme); +protocol.setUrl(protocolUrl); +protocol.setAdminUrl(protocolAdminUrl); +driverMeta.addProtocol(protocol); } else if(lookForDrivers qName != null qName.equals(SCHEME_QNAME)) { scheme = buffy.toString(); +} +else if(lookForDrivers qName != null + qName.equals(URL_QNAME)) +{ +protocolUrl = buffy.toString(); +} +else if(lookForDrivers qName != null + qName.equals(ADMIN_URL_QNAME)) +{ +protocolAdminUrl = buffy.toString(); } else if(lookForDrivers qName != null qName.equals(DRIVER_ELEMENT_QNAME)) 1.5 +3 -4 jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DriverMetaData.java Index: DriverMetaData.java === RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DriverMetaData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- DriverMetaData.java 27 Oct 2002 22:27:18 - 1.4 +++ DriverMetaData.java 30 Nov 2002 00:43:23 - 1.5 @@ -68,7 +68,6 @@ public interface DriverMetaData { -public static final String DEFAULT_PROTOCOL_NAME = default.protocol; /** * The purpose of this method is to return the name of this driver 1.9 +10 -14 jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DriverMetaDataImpl.java Index: DriverMetaDataImpl.java === RCS file:
cvs commit: jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database DriverServiceGetInitTest.java
prickett2002/11/29 19:35:05 Modified: periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database DriverContentHandler.java DriverMetaDataImpl.java periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database DriverServiceGetInitTest.java Log: Removed getLogMessage from GetInitTest Added code to DriverContentHandler to set the protocol name. Added logging code to addProtocol in DriverMetaDataImpl Revision ChangesPath 1.10 +11 -3 jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DriverContentHandler.java Index: DriverContentHandler.java === RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DriverContentHandler.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- DriverContentHandler.java 30 Nov 2002 02:25:51 - 1.9 +++ DriverContentHandler.java 30 Nov 2002 03:35:05 - 1.10 @@ -200,6 +200,14 @@ throw new SAXException(UNEXPECTED EXCEPTION 2); } } +else if(lookForDrivers qName != null + qName.equals(PROTOCOL_ELEMENT_QNAME)) +{ +if(attributes != null) +{ +protocolName = attributes.getValue(NAME_QNAME_ATTRIBUTE); +} +} else if(lookForDrivers qName != null) { buffy = new StringBuffer(); 1.11 +35 -4 jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DriverMetaDataImpl.java Index: DriverMetaDataImpl.java === RCS file: /home/cvs/jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/java/org/apache/commons/periodicity/database/DriverMetaDataImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- DriverMetaDataImpl.java 30 Nov 2002 02:25:51 - 1.10 +++ DriverMetaDataImpl.java 30 Nov 2002 03:35:05 - 1.11 @@ -69,6 +69,8 @@ import java.util.Set; import java.util.Iterator; import java.util.Collection; +import org.apache.log4j.Logger; +import org.apache.log4j.LogManager; public class DriverMetaDataImpl implements DriverMetaData { @@ -95,6 +97,8 @@ /** A variable to store the properties of the driver */ private Map driverMap = null; +private static Logger logger = null; + /** * The purpose of this method is to create a new driver meta data * implementation given a name and a set of properties. @@ -240,13 +244,30 @@ */ void addProtocol(DriverProtocol newval) throws Exception { +if(getLogger() != null) +{ +getLogger().debug(Adding a protocol...); +} if(newval != null) { +if(getLogger() != null) +{ +getLogger().debug(newval.toString()); +} if(protocols == null) { +if(getLogger() != null) +{ +getLogger().debug(protocols == null); +} protocols = new Hashtable(); } protocols.put(newval.getName(), newval); +if(getLogger() != null) +{ +getLogger().debug(protocols.size() + String.valueOf( + protocols.size())); +} } else if(newval == null) { @@ -470,10 +491,12 @@ buffy.append(getWebUrl()); buffy.append(\\ngetClassName()=\); buffy.append(getClassName()); -buffy.append(\\nPROTOCOLS\n); +buffy.append(\\n); Collection protocols = getProtocols(); if(protocols != null) { +buffy.append(String.valueOf(protocols.size())); +buffy.append( PROTOCOLS\n); Iterator iter = protocols.iterator(); if(iter != null) { @@ -547,6 +570,14 @@ return buffy.toString(); } +private Logger getLogger() +{ +if(logger == null) +{ +logger = LogManager.getRootLogger(); +} +return logger; +} } 1.9 +3 -57 jakarta-commons-sandbox/periodicity/src/plugins-build/database/src/test/org/apache/commons/periodicity/database/DriverServiceGetInitTest.java Index: DriverServiceGetInitTest.java
cvs commit: jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/core TestArgTag.java TestNewTag.java
rwaldhoff2002/11/29 23:41:21 Modified:jelly/src/java/org/apache/commons/jelly/tags/core ArgTag.java InvokeTag.java NewTag.java UseBeanTag.java jelly/src/test/org/apache/commons/jelly/core TestNewTag.java Added: jelly/src/test/org/apache/commons/jelly/core TestArgTag.java Log: cleanup ArgTag add tests Revision ChangesPath 1.2 +184 -80 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/ArgTag.java Index: ArgTag.java === RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/ArgTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ArgTag.java 28 Nov 2002 00:22:23 - 1.1 +++ ArgTag.java 30 Nov 2002 07:41:21 - 1.2 @@ -2,7 +2,6 @@ * $Header$ * $Revision$ * $Date$ - * * * * The Apache Software License, Version 1.1 @@ -61,122 +60,98 @@ */ package org.apache.commons.jelly.tags.core; +import java.util.HashMap; +import java.util.Map; + +import org.apache.commons.beanutils.ConversionException; +import org.apache.commons.beanutils.Converter; +import org.apache.commons.beanutils.converters.BooleanConverter; +import org.apache.commons.beanutils.converters.ByteConverter; +import org.apache.commons.beanutils.converters.CharacterConverter; +import org.apache.commons.beanutils.converters.DoubleConverter; +import org.apache.commons.beanutils.converters.FloatConverter; +import org.apache.commons.beanutils.converters.IntegerConverter; +import org.apache.commons.beanutils.converters.LongConverter; +import org.apache.commons.beanutils.converters.ShortConverter; import org.apache.commons.jelly.JellyException; import org.apache.commons.jelly.XMLOutput; -import org.apache.commons.jelly.expression.Expression; -/** An argument to a {@link NewTag} or {@link InvokeTag}. - * This tag MUST be enclosed within an {@link ArgTagParent} - * implementation. - * - * @author Rodney Waldhoff - * @version $Revision$ - */ +/** + * An argument to a {@link NewTag} or {@link InvokeTag}. + * This tag MUST be enclosed within an {@link ArgTagParent} + * implementation. + * + * @author Rodney Waldhoff + * @version $Revision$ + */ public class ArgTag extends BaseClassLoaderTag { + +// constructors +//- -/** The name of the parameter type, if any. */ -private String typeString; - -/** An {@link Expression} describing the parameter value. */ -private Expression valueExpression; - -/** The parameter value as {@link #setValueObject set} by some child tag (if any). */ -private Object valueObject; - public ArgTag() { } -/** The name of the parameter type, if any. */ +// attribute setters +//- + +/** + * The name of the argument class or type, if any. + * This may be a fully specified class name or + * a primitive type name + * (codebooleancode, codeint/code, codedouble/code, etc.). + */ public void setType(String type) { this.typeString = type; } -/** The parameter value. */ -public void setValue(Expression value) { -this.valueExpression= value; -} - -/** (used by child tags) */ -public void setValueObject(Object object) { -this.valueObject = object; +/** The (possibly null) value of this argument. */ +public void setValue(Object value) { +this.value= value; } -// Tag interface -//- +// tag methods +//- + public void doTag(XMLOutput output) throws Exception { invokeBody(output); -if(null != valueObject null != valueExpression) { -throw new JellyException(Either the value parameter or a value-setting child element can be provided, but not both.); -} + Class klass = null; -Object value = valueObject; -if(null == value null != valueExpression) { -value = valueExpression.evaluate(context); -} if(boolean.equals(typeString)) { klass = Boolean.TYPE; -assertNotNull(value); -if(!(value instanceof Boolean) null != valueExpression) { -value = new Boolean(valueExpression.evaluateAsBoolean(context));