cvs commit: jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain Catalog.java Chain.java Command.java Filter.java
martinc 2003/10/21 23:21:24 Modified:chain/src/java/org/apache/commons/chain Catalog.java Chain.java Command.java Filter.java Log: Checkstyle cleanup. Revision ChangesPath 1.5 +8 -8 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/Catalog.java Index: Catalog.java === RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/Catalog.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Catalog.java 1 Oct 2003 12:31:50 - 1.4 +++ Catalog.java 22 Oct 2003 06:21:24 - 1.5 @@ -83,7 +83,7 @@ * pA default context attribute for storing a default [EMAIL PROTECTED] Catalog}, * provided as a convenience only./p */ -public final static String CATALOG_KEY = org.apache.commons.chain.CATALOG; +public static final String CATALOG_KEY = org.apache.commons.chain.CATALOG; /** @@ -95,7 +95,7 @@ * @param command [EMAIL PROTECTED] Command} or [EMAIL PROTECTED] Chain} to be returned * for later lookups on this name */ -public void addCommand(String name, Command command); +void addCommand(String name, Command command); /** @@ -105,7 +105,7 @@ * @param name Name for which a [EMAIL PROTECTED] Command} or [EMAIL PROTECTED] Chain} * should be retrieved */ -public Command getCommand(String name); +Command getCommand(String name); @@ -114,7 +114,7 @@ * known to this [EMAIL PROTECTED] Catalog}. If there are no known commands, * an empty Iterator is returned./p */ -public Iterator getNames(); +Iterator getNames(); } 1.5 +6 -6 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/Chain.java Index: Chain.java === RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/Chain.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Chain.java1 Oct 2003 12:31:50 - 1.4 +++ Chain.java22 Oct 2003 06:21:24 - 1.5 @@ -113,7 +113,7 @@ * @exception IllegalStateException if this [EMAIL PROTECTED] Chain} has already * been executed at least once, so no further configuration is allowed */ -public void addCommand(Command command); +void addCommand(Command command); /** @@ -157,7 +157,7 @@ * of this [EMAIL PROTECTED] Context} should be delegated to a subsequent * [EMAIL PROTECTED] Command} in an enclosing [EMAIL PROTECTED] Chain} */ -public boolean execute(Context context) throws Exception; +boolean execute(Context context) throws Exception; } 1.4 +5 -5 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/Command.java Index: Command.java === RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/Command.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Command.java 1 Oct 2003 12:31:50 - 1.3 +++ Command.java 22 Oct 2003 06:21:24 - 1.4 @@ -145,7 +145,7 @@ * of this [EMAIL PROTECTED] Context} should be delegated to a subsequent * [EMAIL PROTECTED] Command} in an enclosing [EMAIL PROTECTED] Chain} */ -public boolean execute(Context context) throws Exception; +boolean execute(Context context) throws Exception; } 1.4 +5 -5 jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/Filter.java Index: Filter.java === RCS file: /home/cvs/jakarta-commons-sandbox/chain/src/java/org/apache/commons/chain/Filter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Filter.java 1 Oct 2003 12:32:03 - 1.3 +++ Filter.java 22 Oct 2003 06:21:24 - 1.4 @@ -106,7 +106,7 @@ * method (and therefore need not be rethrown), return codetrue/code; * otherwise return codefalse/code */ - public boolean postprocess(Context context, Exception exception); + boolean postprocess(Context context, Exception exception); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript validateByte.js validateCreditCard.js validateDate.js validateEmail.js validateFloat.js validateFloatRange.js validateIntRange.js validateInteger.js validateMask.js validateMaxLength.js validateMinLength.js validateRequired.js validateShort.js
rleland 2003/10/22 00:20:58 Modified:validator/src/javascript/org/apache/commons/validator/javascript validateByte.js validateCreditCard.js validateDate.js validateEmail.js validateFloat.js validateFloatRange.js validateIntRange.js validateInteger.js validateMask.js validateMaxLength.js validateMinLength.js validateRequired.js validateShort.js Log: Bug 23972 Non printing characters were coming from buffer not being read completely. This uncovered a pending issue that needs a new bug ticket opened and that is the case of the javascript names, both the file name and the JS name. Any DoubleCamel validatots will not be found if it's name in the struts validator-rules.xml isn't also properly cased. So: intRange/creditCard is found since it's name properly doubled cased. However, minlength, maxlength is not found. More details will follow in the new Bug Report. Revision ChangesPath 1.3 +3 -3 jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateByte.js Index: validateByte.js === RCS file: /home/cvs/jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateByte.js,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- validateByte.js 15 Aug 2003 20:20:40 - 1.2 +++ validateByte.js 22 Oct 2003 07:20:57 - 1.3 @@ -1,7 +1,7 @@ + //$Header$ //$Revision$ //$Date$ - function validateByte(form) { var bValid = true; 1.3 +4 -4 jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateCreditCard.js Index: validateCreditCard.js === RCS file: /home/cvs/jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateCreditCard.js,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- validateCreditCard.js 15 Aug 2003 20:20:40 - 1.2 +++ validateCreditCard.js 22 Oct 2003 07:20:57 - 1.3 @@ -1,8 +1,8 @@ + //$Header$ //$Revision$ //$Date$ - function validateCreditCard(form) { var bValid = true; var focusField = null; @@ -63,4 +63,4 @@ } } return true; -} +} \ No newline at end of file 1.4 +5 -4 jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateDate.js Index: validateDate.js === RCS file: /home/cvs/jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateDate.js,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- validateDate.js 26 Sep 2003 17:03:22 - 1.3 +++ validateDate.js 22 Oct 2003 07:20:57 - 1.4 @@ -1,3 +1,4 @@ + //$Header$ //$Revision$ //$Date$ @@ -128,7 +129,7 @@ } return bValid; } - + function isValidDate(day, month, year) { if (month 1 || month 12) { return false; 1.3 +4 -3 jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateEmail.js Index: validateEmail.js === RCS file: /home/cvs/jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateEmail.js,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- validateEmail.js 15 Aug 2003 20:20:40 - 1.2 +++ validateEmail.js 22 Oct 2003 07:20:57 - 1.3 @@ -1,3 +1,4 @@ + //$Header$ //$Revision$ //$Date$ 1.5 +3 -3 jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateFloat.js Index: validateFloat.js === RCS file: /home/cvs/jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateFloat.js,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- validateFloat.js 22 Oct 2003 04:18:42 - 1.4 +++ validateFloat.js 22 Oct 2003 07:20:57 - 1.5 @@ -1,7 +1,7 @@ + //$Header$ //$Revision$ //$Date$ - function validateFloat(form) { var bValid = true; 1.3 +5 -5 jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateFloatRange.js Index: validateFloatRange.js
DO NOT REPLY [Bug 23990] - EmailValidator - valid email address fails
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=23990. 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=23990 EmailValidator - valid email address fails --- Additional Comments From [EMAIL PROTECTED] 2003-10-22 09:17 --- [EMAIL PROTECTED] is *NOT* a valid email address the ip address should be encolsed in [] as in [EMAIL PROTECTED] Therefore the observed behaviour of case 2 correct and it is Not A Bug. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 23990] - EmailValidator - valid email address fails
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=23990. 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=23990 EmailValidator - valid email address fails --- Additional Comments From [EMAIL PROTECTED] 2003-10-22 09:27 --- If B[EMAIL PROTECTED]/B is a valid email address, then even for this, the output is false bcos in the code, the pattern that matches the domain is ^(\\d{1,3})[.](\\d{1,3})[.](\\d{1,3})[.](\\d{1,3})$ where it says that the domain can only have digits and not [ or ] in the email addresss. So it again boils down to a *BUG*. Thanks Srirajesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DO NOT REPLY [Bug 23990] - EmailValidator - valid email address fails
So it again boils down to a *BUG*. But not the same bug.. *** The information in this e-mail is confidential and for use by the addressee(s) only. If you are not the intended recipient (or responsible for delivery of the message to the intended recipient) please notify us immediately on 0141 306 2050 and delete the message from your computer. You may not copy or forward it or use or disclose its contents to any other person. As Internet communications are capable of data corruption Student Loans Company Limited does not accept any responsibility for changes made to this message after it was sent. For this reason it may be inappropriate to rely on advice or opinions contained in an e-mail without obtaining written confirmation of it. Neither Student Loans Company Limited or the sender accepts any liability or responsibility for viruses as it is your responsibility to scan attachments (if any). Opinions and views expressed in this e-mail are those of the sender and may not reflect the opinions and views of The Student Loans Company Limited. This footnote also confirms that this email message has been swept for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [dbutils] ResultSetMetaDataHandler
I was looking at an older version and didn't remember these methods had been removed. Beyond these, there is no other need for the handler. Dumping it is fine. Quoting David Graham [EMAIL PROTECTED]: --- Steven Caswell [EMAIL PROTECTED] wrote: The idea behind the ResultSetMetaDataHandler is to allow a caller to get to the result set metadata without actually having access to the result set, such as when the result set is being consumed and passed back in some other form. For example, looking at the DbUtils class, the executeListQuery consumes the result set. There is no easy way for the caller to get access to the metadata except through the handler. The new code does not contain methods like executeListQuery that don't accept a ResultSetHandler. I still don't see a need for ResultSetMetaDataHandler since all the methods take a ResultSetHandler which has access to the meta data. David Steven Caswell Sun Certified Java Programmer [EMAIL PROTECTED] a.k.a Mungo Knotwise of Michel Delving One ring to rule them all, one ring to find them... -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 21, 2003 9:55 AM To: [EMAIL PROTECTED] Subject: [dbutils] ResultSetMetaDataHandler I'm having trouble thinking of a use case that supports the need for the ResultSetMetaDataHandler interface. I view meta data handling as part of handling a ResultSet so it can be done in a ResultSetHandler. Because ResultSetHandler can call rs.getMetaData(), I don't see a need for a separate interface and the additions of methods to QueryRunner to support it. This is an effort to simplify the dbutils API; I don't think ResultSetMetaDataHandler is pulling it's weight. If no one is opposed, I'll remove ResultSetMetaDataHandler tommorrow. David __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Steven Caswell (Hobbit name Mungo Knotwise of Michel Delving) [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 21269] - FileUploadBase does not handle quoted boundary specification, which is required by RFC 1521
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=21269. 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=21269 FileUploadBase does not handle quoted boundary specification, which is required by RFC 1521 --- Additional Comments From [EMAIL PROTECTED] 2003-10-22 11:53 --- here is a patch that worked !!! String boundaryString; byte[] boundary; if (contentType.charAt(boundaryIndex + 9) == '' contentType.charAt(contentType.length() - 1) == '') { boundaryString = contentType.substring( boundaryIndex + 10, contentType.length() - 1); } else { boundaryString = contentType.substring( boundaryIndex + 9); } boundary = boundaryString.getBytes(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[CLI] CLI2 Tasks
I've been trawling through the mail archives and - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[CLI] 2.x Tasks
I've been trawling through the mail archives and open bugs to try and produce a comprehensive task list for CLI2. The list is broadly broken down into 6 sections and also contains a couple of items from my head. If we can weed out any nonsense and add any missing tasks I'll then go through and create/ammend bugzilla entries, after that we can try and figure out which are needed for 2.0 and which can be deferred for 2.x. I've got ideas on how to tackle some of the issues but I'll follow up with comments on them separately. Anyway the list follows. Rob Minor Enhancements 1.1) Posix option parsing should be default Posix parsing should be preferred. I.e. -buildfile should be parsed in the following order of preference -b uildfile -b -u -i -l -d -f -i -l -e. -buildfile http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102008725729133w=2 1.2) Property options don't need '=' sign When parsing -D style property options the absense of '=' should indicate that the property be set with a value of true. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102435665623207w=2 1.3) Enum Argument Values Options should allow a list of possible values to validate against. Currently this is in StringValidator but would EnumValidator be better name? StringArrayValidator is also a suggested name. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102750803811805w=2 http://marc.theaimsgroup.com/?l=jakarta-commons-devm=103951380212779w=2 1.4) CommandLine Options should be ordered When processing the options in a CommandLine instance it is sometimes relevant to know what order they were set in. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=103183663329683w=2 1.5) Ordering options in help When options are displayed in help it would be useful to use the order the options were set in. Bug#: 20216 Bigger Enhancements 2.1) Interrogation using switch statement It should be possible to interrogate options using a simple a switch in a loop. This requires a unique integer id for each option. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102763403105912w=2 2.2) Multiple Option Occurrences When the same option occurs multiple times this should be recorded in the CommandLine. For example while -v might mean verbose, -v -v might mean very verbose. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102820668701775w=2 2.3) All arguments should have ConsumeRemaining behaviour ConsumeRemainingOption could be dropped in favour of the feature being added to ArgumentImpl. This would mean that the concept of unprocessed options could be removed and the values could still be validated and associated with arguments. 2.3) Factored out help for common groups If the same group is used within several different options then the help system should be able to display the information more consisely. I.e. the common group is printed separately. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=104452882903157w=2 Validators and Triggers 3.1) Per option Triggers When an option is processed some custom trigger (ala SQL) could be fired. This would allow user defined actions to take place as soon as the relevant option is processed. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=101230300911853w=2 http://marc.theaimsgroup.com/?l=jakarta-commons-devm=104690244101751w=2 3.2) RegularExpressionValidator A validator should be supplied allowing values to be checked against regular expressions. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=103951380212779w=2 Default Values 4.1) Default Values at Definition Stage When creating Arguments the default value(s) are often already known. It might make sense to allow default's to be supplied when building the Argument instance. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=101027884006565w=2 4.2) Default Values from Properties object When processing a command line it would be useful to be able to take default values from a properties object. This way user/project/system preferences could be applied automatically. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=101027884006565w=2 4.3) CommandLine state can be written to Properties This would allow command line defaults to be saved for the next invocation (see Default Values from Properties object). http://marc.theaimsgroup.com/?l=jakarta-commons-devm=103731591230259w=2 4.4) Defaults supplied at interrogation stage CLI1 allows defaults to be supplied at the point of interrogation, CLI2 should do the same. Construction and Wrapping 5.1) Reflection Builder It should be possible for CLI to use reflection on a bean and provide a command line interface to it. Bug#: 20211 http://marc.theaimsgroup.com/?l=jakarta-commons-devm=104288286123791w=2 http://marc.theaimsgroup.com/?l=jakarta-commons-devm=106651701602044w=2 5.2) Interaction with Commons-Configuration A
Re: [CLI] 2.x Tasks
- Original Message - From: Rob Oxspring [EMAIL PROTECTED] To: Jakarta Commons Developers List [EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 3:19 PM Subject: [CLI] 2.x Tasks I've been trawling through the mail archives and open bugs to try and produce a comprehensive task list for CLI2. The list is broadly broken down into 6 sections and also contains a couple of items from my head. If we can weed out any nonsense and add any missing tasks I'll then go through and create/ammend bugzilla entries, after that we can try and figure out which are needed for 2.0 and which can be deferred for 2.x. I've got ideas on how to tackle some of the issues but I'll follow up with comments on them separately. Anyway the list follows. Rob Minor Enhancements 1.1) Posix option parsing should be default Posix parsing should be preferred. I.e. -buildfile should be parsed in the following order of preference -b uildfile -b -u -i -l -d -f -i -l -e. -buildfile http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102008725729133w=2 1.2) Property options don't need '=' sign When parsing -D style property options the absense of '=' should indicate that the property be set with a value of true. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102435665623207w=2 1.3) Enum Argument Values Options should allow a list of possible values to validate against. Currently this is in StringValidator but would EnumValidator be better name? StringArrayValidator is also a suggested name. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102750803811805w=2 http://marc.theaimsgroup.com/?l=jakarta-commons-devm=103951380212779w=2 All of the above should all be pretty easy to do, and I've got no strong opinion on any of them. 1.4) CommandLine Options should be ordered When processing the options in a CommandLine instance it is sometimes relevant to know what order they were set in. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=103183663329683w=2 1.5) Ordering options in help When options are displayed in help it would be useful to use the order the options were set in. Bug#: 20216 These two should be pretty straight forward - Group and CommandLine should take a deal with a List of options instead/as well as the current Set. Bigger Enhancements 2.1) Interrogation using switch statement It should be possible to interrogate options using a simple a switch in a loop. This requires a unique integer id for each option. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102763403105912w=2 I suppose we could do this but the loop+switch approach doesn't seem any easier/shorter than the if/else approach to me. Haven't thought in depth though. 2.2) Multiple Option Occurrences When the same option occurs multiple times this should be recorded in the CommandLine. For example while -v might mean verbose, -v -v might mean very verbose. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102820668701775w=2 I guess we could add a Bag (either depend on collections or use MapOption,Integer) for the options and a getOptionCount() method. 2.3) All arguments should have ConsumeRemaining behaviour ConsumeRemainingOption could be dropped in favour of the feature being added to ArgumentImpl. This would mean that the concept of unprocessed options could be removed and the values could still be validated and associated with arguments. One that occurred to me while reading about the initial reasons/code for the -- option. Should make things even more flexible. 2.3) Factored out help for common groups If the same group is used within several different options then the help system should be able to display the information more consisely. I.e. the common group is printed separately. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=104452882903157w=2 Validators and Triggers 3.1) Per option Triggers When an option is processed some custom trigger (ala SQL) could be fired. This would allow user defined actions to take place as soon as the relevant option is processed. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=101230300911853w=2 http://marc.theaimsgroup.com/?l=jakarta-commons-devm=104690244101751w=2 Could be implemented as Validators but the class/method names seem wrong then. Not sure this is a huge problem though as I think the use as triggers will be pretty rare. Soft dependancies on [functor] should probably come when [functor] gets a 1.0 release. 3.2) RegularExpressionValidator A validator should be supplied allowing values to be checked against regular expressions. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=103951380212779w=2 Default Values 4.1) Default Values at Definition Stage When creating Arguments the default value(s) are often already known. It might make sense to allow default's to be supplied
Re: [math] Complex implementation
I'm going to start a list of references to these threads in the xdoc, so we can always get back to it from the home page. When people have questions about the decisions and issues about complex, we'll be able to point them at the history of discussion on the topic. -Mark Brent Worden wrote: Here's the previous complex thread is was referring to http://nagoya.apache.org/eyebrowse/ReadMsg?listId=15msgNo=28132 Brent Worden http://www.brent.worden.org -Original Message- From: Brent Worden [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 21, 2003 10:53 PM To: Jakarta Commons Developers List Subject: RE: [math] Complex implementation I know we've talked about this before, It's not fresh in my mind why we decided against it. -Mark Looking back at the mail archives, it appears we decided against a complex class mainly for two reasons: 1) Not too many RW applications warrant a complex class and can be accommodated with two double values. 2) There are plenty of other OS, complex implementations available so it wasn't crucial to having one in commons-math. Brent Worden http://www.brent.worden.org - 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] -- Mark Diggory Software Developer Harvard MIT Data Center http://www.hmdc.harvard.edu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/math/xdocs tasks.xml
mdiggory2003/10/22 08:00:44 Modified:math/xdocs tasks.xml Log: Added references to email threads concering complex numbers. Revision ChangesPath 1.10 +11 -2 jakarta-commons-sandbox/math/xdocs/tasks.xml Index: tasks.xml === RCS file: /home/cvs/jakarta-commons-sandbox/math/xdocs/tasks.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- tasks.xml 26 Sep 2003 19:30:33 - 1.9 +++ tasks.xml 22 Oct 2003 15:00:44 - 1.10 @@ -54,7 +54,16 @@ pWhile we are interested in implementing these aspects of the library, we have decided to hold off on their development at this time./p dl dtComplex Number Library./dt - ddAdd comments here./dd + ddA great deal of thought has gone into the issues surrounding a Complex Implementation. As discussions on the subject continue to grow, we will make them available so new user, contributors, etc will have an idea of the issues surrounding this subject. + ul + lia href=http://nagoya.apache.org/eyebrowse/ReadMsg?listId=15amp;msgNo=28132; + Thread Subject: [math] Complex dilemmas + /a/li + lia href=http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]msgNo=36293 + Thread Subject: [math] Complex implementation + /a/li + /ul + /dd /dl /subsection /section - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [CLI] 2.x Tasks
Minor Enhancements 1.1) Posix option parsing should be default Posix parsing should be preferred. I.e. -buildfile should be parsed in the following order of preference -b uildfile -b -u -i -l -d -f -i -l -e. -buildfile http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102008725729133w=2 +1 1.2) Property options don't need '=' sign When parsing -D style property options the absense of '=' should indicate that the property be set with a value of true. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102435665623207w=2 +1 1.3) Enum Argument Values Options should allow a list of possible values to validate against. Currently this is in StringValidator but would EnumValidator be better name? StringArrayValidator is also a suggested name. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102750803811805w=2 http://marc.theaimsgroup.com/?l=jakarta-commons-devm=103951380212779w=2 +1 to EnumValidator 1.4) CommandLine Options should be ordered When processing the options in a CommandLine instance it is sometimes relevant to know what order they were set in. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=103183663329683w=2 +1 1.5) Ordering options in help When options are displayed in help it would be useful to use the order the options were set in. Bug#: 20216 This should be configurable by supplying a comparator. Bigger Enhancements 2.1) Interrogation using switch statement It should be possible to interrogate options using a simple a switch in a loop. This requires a unique integer id for each option. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102763403105912w=2 +1 (got to keep the features that were available in the original) 2.2) Multiple Option Occurrences When the same option occurs multiple times this should be recorded in the CommandLine. For example while -v might mean verbose, -v -v might mean very verbose. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102820668701775w=2 I forgot about this. Possibly a 2.x? 2.3) All arguments should have ConsumeRemaining behaviour ConsumeRemainingOption could be dropped in favour of the feature being added to ArgumentImpl. This would mean that the concept of unprocessed options could be removed and the values could still be validated and associated with arguments. +1 2.3) Factored out help for common groups If the same group is used within several different options then the help system should be able to display the information more consisely. I.e. the common group is printed separately. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=104452882903157w=2 2.x I would say. Validators and Triggers 3.1) Per option Triggers When an option is processed some custom trigger (ala SQL) could be fired. This would allow user defined actions to take place as soon as the relevant option is processed. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=101230300911853w=2 http://marc.theaimsgroup.com/?l=jakarta-commons-devm=104690244101751w=2 I'd leave this out for a while. It sounds like some of functor stuff that was mentioned before. 3.2) RegularExpressionValidator A validator should be supplied allowing values to be checked against regular expressions. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=103951380212779w=2 +1 Default Values 4.1) Default Values at Definition Stage When creating Arguments the default value(s) are often already known. It might make sense to allow default's to be supplied when building the Argument instance. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=101027884006565w=2 +1 4.2) Default Values from Properties object When processing a command line it would be useful to be able to take default values from a properties object. This way user/project/system preferences could be applied automatically. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=101027884006565w=2 +1 - should be an abstract solution with impls for particular forms (e.g. props, prefs). 4.3) CommandLine state can be written to Properties This would allow command line defaults to be saved for the next invocation (see Default Values from Properties object). http://marc.theaimsgroup.com/?l=jakarta-commons-devm=103731591230259w=2 +1 - a Writer to 4.2's Reader 4.4) Defaults supplied at interrogation stage CLI1 allows defaults to be supplied at the point of interrogation, CLI2 should do the same. +1 Construction and Wrapping 5.1) Reflection Builder It should be possible for CLI to use reflection on a bean and provide a command line interface to it. Bug#: 20211 http://marc.theaimsgroup.com/?l=jakarta-commons-devm=104288286123791w=2 http://marc.theaimsgroup.com/?l=jakarta-commons-devm=106651701602044w=2 +1 this will be very useful 5.2) Interaction with
[dbutils] ResultSetHandler.handle() method
Currently, the ResultSetHandler.handle() method has this signature: public Object handle(ResultSet rs, Object params[], Object userObject) throws SQLException; The mail archives show the initial suggestions was the simpler: public Object handle(ResultSet rs) throws SQLException; None of the handler implementations in DbUtils use the params or userObject parameters and the cvs commit that made this change gives no reason why it was made. What is the use case supporting the additional parameters? Should we go back to the original version that just takes a ResultSet? David __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2 HelpFormatter.java BurstException.java GroupImpl.java MissingValueException.java UnexpectedValueException.java Comparators.java MissingOptionException.java OptionException.java UnexpectedOptionException.java
roxspring2003/10/22 09:32:15 Modified:cli/src/test/org/apache/commons/cli2 SwitchTest.java ParentTest.java CommandTest.java PropertyOptionTest.java ConsumeRemainingOptionTest.java HelpFormatterTest.java GroupTest.java ArgumentTest.java DefaultOptionTest.java cli/src/java/org/apache/commons/cli2 HelpFormatter.java BurstException.java GroupImpl.java MissingValueException.java UnexpectedValueException.java Comparators.java MissingOptionException.java OptionException.java UnexpectedOptionException.java Log: Option order is now preserved in groups. Options in groups are now stored as a List rather than Set. All appendUsage(..) and helpLines(..) methods can now take a null Comparator to use the original order. Comparators.DEFAULT has been removed as its no longer needed and all references are now initialised to null. Therefore option order is now preserved by default Revision ChangesPath 1.2 +259 -259 jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/SwitchTest.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/SwitchTest.java.diff?r1=1.1r2=1.2 1.2 +445 -445 jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/ParentTest.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/ParentTest.java.diff?r1=1.1r2=1.2 1.2 +259 -259 jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/CommandTest.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/CommandTest.java.diff?r1=1.1r2=1.2 1.2 +257 -257 jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/PropertyOptionTest.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/PropertyOptionTest.java.diff?r1=1.1r2=1.2 1.2 +265 -265 jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/ConsumeRemainingOptionTest.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/ConsumeRemainingOptionTest.java.diff?r1=1.1r2=1.2 1.2 +326 -326 jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/HelpFormatterTest.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/HelpFormatterTest.java.diff?r1=1.1r2=1.2 1.2 +442 -440 jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/GroupTest.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/GroupTest.java.diff?r1=1.1r2=1.2 1.2 +423 -423 jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/ArgumentTest.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/ArgumentTest.java.diff?r1=1.1r2=1.2 1.2 +247 -247 jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/DefaultOptionTest.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/DefaultOptionTest.java.diff?r1=1.1r2=1.2 1.2 +4 -4 jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/HelpFormatter.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/HelpFormatter.java.diff?r1=1.1r2=1.2 1.2 +81 -81 jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/BurstException.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/BurstException.java.diff?r1=1.1r2=1.2 1.2 +38 -10 jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/GroupImpl.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/GroupImpl.java.diff?r1=1.1r2=1.2 1.3 +4 -4 jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/MissingValueException.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/MissingValueException.java.diff?r1=1.2r2=1.3 1.2 +85 -85 jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/UnexpectedValueException.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/UnexpectedValueException.java.diff?r1=1.1r2=1.2 1.2 +405 -413 jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/Comparators.java http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/Comparators.java.diff?r1=1.1r2=1.2 1.2 +77 -77
cvs commit: jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2 DocumentationTest.java HelpFormatterTest.java
roxspring2003/10/22 10:01:06 Modified:cli/src/java/org/apache/commons/cli2 HelpFormatter.java CommandLineParser.java cli/src/test/org/apache/commons/cli2 DocumentationTest.java HelpFormatterTest.java Log: Added PrintWriter attribute to HelpFormatter and removed the remaining argment from the print(..) method. A bonus ofthis is that none of the cli2 tests print to System.out any more Revision ChangesPath 1.3 +24 -4 jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/HelpFormatter.java Index: HelpFormatter.java === RCS file: /home/cvs/jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/HelpFormatter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- HelpFormatter.java22 Oct 2003 16:32:14 - 1.2 +++ HelpFormatter.java22 Oct 2003 17:01:06 - 1.3 @@ -113,6 +113,8 @@ private String footer = null; private String shellCommand = ; + +private PrintWriter out = new PrintWriter(System.out);//or should this default to .err? private final String gutterLeft; private final String gutterCenter; @@ -156,8 +158,10 @@ throw new IllegalArgumentException(The gutter strings leave no space for output! Supply shorter gutters or more width.); } } + + - public void print(final PrintWriter out) throws IOException { + public void print() throws IOException { printHeader(out); printException(out); printUsage(out); @@ -516,5 +520,21 @@ public String getShellCommand() { return shellCommand; } + +/** + * @param out The out to set. + */ +public void setPrintWriter(PrintWriter out) +{ +this.out = out; +} + +/** + * @return Returns the out. + */ +public PrintWriter getPrintWriter() +{ +return out; +} } 1.2 +4 -5 jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/CommandLineParser.java Index: CommandLineParser.java === RCS file: /home/cvs/jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/CommandLineParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- CommandLineParser.java18 Oct 2003 22:00:07 - 1.1 +++ CommandLineParser.java22 Oct 2003 17:01:06 - 1.2 @@ -137,8 +137,7 @@ } // print help - helpFormatter.print( - new PrintWriter(new OutputStreamWriter(System.out))); + helpFormatter.print(); return null; } 1.2 +313 -306 jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/DocumentationTest.java Index: DocumentationTest.java === RCS file: /home/cvs/jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/DocumentationTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- DocumentationTest.java18 Oct 2003 22:00:33 - 1.1 +++ DocumentationTest.java22 Oct 2003 17:01:06 - 1.2 @@ -1,306 +1,313 @@ -/* - * Created on 10-Aug-2003 - * - * To change the template for this generated file go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -package org.apache.commons.cli2; - -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; - -import junit.framework.TestCase; - -/** - * @author Rob - * - * To change the template for this generated type comment go to - * Window - Preferences - Java - Code Generation - Code and Comments - */ -public class DocumentationTest extends TestCase { - - public void testBasicUsage() throws IOException, OptionException { - /* - * --version - * -? -h --help - * -log file - * -s|-q|-v|-d - * Bursting - * File/Num/Date validation - * Switches - * Commands - * Auto help - * Auto exception help - * - */ - DefaultOptionBuilder obuilder = new DefaultOptionBuilder(); - Option version = - obuilder - .withLongName(version) - .withDescription(Displays version information and then exits) - .create(); - - Option help = -
Re: [dbutils] ResultSetHandler.handle() method
Change it to public Object handle(ResultSet rs) throws SQLException. Object params[], Object userObject was for ProcedureUtils. - Original Message - From: David Graham [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 7:10 PM Subject: [dbutils] ResultSetHandler.handle() method Currently, the ResultSetHandler.handle() method has this signature: public Object handle(ResultSet rs, Object params[], Object userObject) throws SQLException; The mail archives show the initial suggestions was the simpler: public Object handle(ResultSet rs) throws SQLException; None of the handler implementations in DbUtils use the params or userObject parameters and the cvs commit that made this change gives no reason why it was made. What is the use case supporting the additional parameters? Should we go back to the original version that just takes a ResultSet? David __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[PATCH] StringUtils.getLevenshteinDistance() fix for OutOfMemoryError when used with LONG strings
I've never submitted a patch for an open-source project before (never got around to it lo these many years I guess), so I apologize for any errors in form or convention that I commit. I was planning on using the StringUtils.getLevenshteinDistance(String,String) method in a particular circumstance where I needed to get the edit distance between two large strings (anywhere between 10K - 500K characters each). However, I found that calling that method (as of v2.0 of commons-lang) would result in an OutOfMemoryError when strings of such lengths were provided. A quick look at the source revealed that the current implementation (which uses the sample impl. at http://www.merriampark.com/ld.htm) creates a matrix with dimensions corresponding to the lengths of the two strings provided. Clearly, a 100K x 100K int[] is problematic. Therefore, I've (mostly) rewritten the method using a two int arrays of the size of the first string's length, and the method now works properly with larger strings (beastly slow, but that's quadratic algorithms for you) . I've tested the new implementation against the ten or so testcases mentioned in the javadocs, as well as another half-dozen of my own, and everything looks good. If my mail client botches the patch diff, you can get it at http://www.snowtide.com/commons-lang-LDpatch.txt Chas Emerick | [EMAIL PROTECTED] http://www.snowtide.com Snowtide Informatics Systems, Inc. == --- StringUtils.java.oldWed Oct 22 12:58:04 2003 +++ StringUtils.javaWed Oct 22 13:51:36 2003 @@ -4255,8 +4255,8 @@ * another, where each change is a single character modification (deletion, * insertion or substitution)./p * - * pThis implementation of the Levenshtein distance algorithm - * is from a href=http://www.merriampark.com/ld.htm;http://www.merriampark.com/ld. htm/a/p + * pThis implementation of the Levenshtein distance algorithm was originally based upon the one + * presented at a href=http://www.merriampark.com/ld.htm;http://www.merriampark.co m/ld.htm/a/p * * pre * StringUtils.getLevenshteinDistance(null, *) = IllegalArgumentException @@ -4281,76 +4281,64 @@ if (s == null || t == null) { throw new IllegalArgumentException(Strings must not be null); } -int d[][]; // matrix -int n; // length of s -int m; // length of t -int i; // iterates through s -int j; // iterates through t -char s_i; // ith character of s -char t_j; // jth character of t -int cost; // cost - -// Step 1 -n = s.length(); -m = t.length(); + + /* + The difference between this impl. and the previous is that, rather than cr eating and retaining a matrix of size + s.length()+1 by t.length()+1, we maintain two single-dimensional arrays of length s.length()+1. The first, d, + is the 'current working' distance array that maintains the newest distance cost counts as we iterate through + the characters of String s. Each time we increment the index of String t we are comparing, d is copied to p, + the second int[]. Doing so allows us to retain the previous cost counts a s required by the algorithm + (taking the minimum of the cost count to the left, up one, and diagonally up and to the left of the current + cost count being calculated). (Note that the arrays aren't really copied anymore, just switched...this is clearly much + better than cloning an array or doing a System.arraycopy() each time throu gh the outer loop.) + + Effectively, the difference between the two implementations is this one do es not cause an out of memory condition + when calculating the LD over two very large strings. + */ + +int n = s.length(); // length of s +int m = t.length(); // length of t + if (n == 0) { return m; -} -if (m == 0) { +} else if (m == 0) { return n; } -d = new int[n + 1][m + 1]; -// Step 2 -for (i = 0; i = n; i++) { -d[i][0] = i; -} +int p[] = new int[n+1]; //'previous' cost array, horizontally +int d[] = new int[n+1]; // cost array, horizontally + int _d[]; //placeholder to assist in swapping p and d -for (j = 0; j = m; j++) { -d[0][j] = j; -} - -// Step 3 -for (i = 1; i = n; i++) { -s_i = s.charAt(i - 1); - -// Step 4 -for (j = 1; j = m; j++) { -t_j = t.charAt(j - 1); - -// Step 5 -if (s_i == t_j) { -cost = 0; -} else { -
Re: [CLI] Validation (was 2.x Tasks)
- Original Message - From: John Keyes [EMAIL PROTECTED] To: Jakarta Commons Developers List [EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 5:10 PM Subject: Re: [CLI] 2.x Tasks snip/ 1.3) Enum Argument Values Options should allow a list of possible values to validate against. Currently this is in StringValidator but would EnumValidator be better name? StringArrayValidator is also a suggested name. http://marc.theaimsgroup.com/?l=jakarta-commons-devm=102750803811805w=2 http://marc.theaimsgroup.com/?l=jakarta-commons-devm=103951380212779w=2 I have renamed the StringValidator. We should not modify the List that is passed to the validate method. It can lead to behaviour not defined by the API e.g. But we could define the behaviour with a few comments :) (taken from DateValidatorTest): final Object[] array = new Object[] { 23/12/03, 2002-10-12 }; final List list = Arrays.asList(array); validator.validate(list); This will actually modify 'array' (see Arrays.asList). This smells. I can definitely understand your thinking but it is a feature I thought was quiet handy too. In the example of DateValidator, checking the string is a valid date involves the creation of a Date object and it seems silly to throw that instance away when we're only going to recreate it later. If you really don't like the idea of modifying the list parameter I suppose we could change the sig to List validate(List) (Although you should be aware that at least DefaultOption's process() method modifies it's ListIterator). I think we should leave the Validator as is and not perform any instance creation. In CLI 1 there was an optional type attribute for Arguments (java.lang.Class). The value of an Argument could be retrieved using two different methods: CommandLine.getOptionValue : String CommandLine.getOptionObject : Object The getOptionObject created the relevant instance from the string value. The way I see it is that for any given option you either want it as a String or an Object. If your validator has checked you have a valid Date or Number then I can't see why you would ever want to get to the original String version back rather than the richer objects. I've got no objection to a convenience method performing the common cast-to-String, but I don't see the need to delay the transformation until the interrogation phase. Rob I think we should use a similar mechanism now. -John K - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/digester/src/test/org/apache/commons/digester/xmlrules DigesterLoaderTest.java
rdonkin 2003/10/22 11:28:58 Modified:digester/src/java/org/apache/commons/digester/xmlrules DigesterLoader.java FromXmlRuleSet.java digester/src/test/org/apache/commons/digester/xmlrules DigesterLoaderTest.java Log: Added ability to load xml rules from org.xml.sax.ImputSource to DigesterLoader Revision ChangesPath 1.9 +33 -3 jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/DigesterLoader.java Index: DigesterLoader.java === RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/DigesterLoader.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- DigesterLoader.java 9 Oct 2003 21:09:48 - 1.8 +++ DigesterLoader.java 22 Oct 2003 18:28:57 - 1.9 @@ -70,7 +70,9 @@ import org.apache.commons.digester.Digester; import org.apache.commons.digester.RuleSet; + import org.xml.sax.SAXException; +import org.xml.sax.InputSource; /** @@ -83,6 +85,34 @@ */ public class DigesterLoader { + +/** + * Creates a new digester and initializes it from the specified InputSource + * @param inputSource load the xml rules from this InputSource + * @return a new Digester initialized with the rules + */ +public static Digester createDigester(InputSource rulesSource) { +RuleSet ruleSet = new FromXmlRuleSet(rulesSource); +Digester digester = new Digester(); +digester.addRuleSet(ruleSet); +return digester; +} + +/** + * Creates a new digester and initializes it from the specified InputSource. + * This constructor allows the digester to be used to load the rules to be specified. + * This allows properties to be configured on the Digester instance before it is used. + * + * @param inputSource load the xml rules from this InputSource + * @param rulesDigester digester to load the specified XML file. + * @return a new Digester initialized with the rules + */ +public static Digester createDigester(InputSource rulesSource, Digester rulesDigester) { +RuleSet ruleSet = new FromXmlRuleSet(rulesSource, rulesDigester); +Digester digester = new Digester(); +digester.addRuleSet(ruleSet); +return digester; +} /** * Creates a new digester and initializes it from the specified XML file 1.10 +97 -16 jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/FromXmlRuleSet.java Index: FromXmlRuleSet.java === RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/FromXmlRuleSet.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- FromXmlRuleSet.java 9 Oct 2003 21:09:48 - 1.9 +++ FromXmlRuleSet.java 22 Oct 2003 18:28:57 - 1.10 @@ -68,6 +68,8 @@ import org.apache.commons.digester.Digester; import org.apache.commons.digester.RuleSetBase; +import org.xml.sax.InputSource; + /** * A Digester rule set where the rules come from an XML file. * @@ -82,17 +84,17 @@ /** * The file containing the Digester rules, in XML. */ -private URL xmlRules; +private XMLRulesLoader rulesLoader; /** * The rule set for parsing the Digester rules */ private DigesterRuleParser parser; - /** - * The digester for loading the rules xml. - */ - private Digester rulesDigester; +/** +* The digester for loading the rules xml. +*/ +private Digester rulesDigester; /** * Constructs a FromXmlRuleSet using the default DigesterRuleParser and @@ -118,8 +120,8 @@ * @param parser an instance of DigesterRuleParser, for parsing the rules from XML */ public FromXmlRuleSet(URL rulesXml, DigesterRuleParser parser) { - this(rulesXml, parser, new Digester()); - } +this(rulesXml, parser, new Digester()); +} /** * @param rulesXml the path to the XML document defining the Digester rules @@ -127,11 +129,54 @@ * @param rulesDigester the digester used to load the Xml rules. */ public FromXmlRuleSet(URL rulesXml, DigesterRuleParser parser, Digester rulesDigester) { -xmlRules = rulesXml; +init(new URLXMLRulesLoader(rulesXml), parser, rulesDigester); +} + +/** + * Constructs a FromXmlRuleSet using the default DigesterRuleParser and + * rulesDigester. + * @param inputSource load the xml rules from this InputSource + */ +public
Re: [CLI] Validation (was 2.x Tasks)
snip/ I can definitely understand your thinking but it is a feature I thought was quiet handy too. In the example of DateValidator, checking the string is a valid date involves the creation of a Date object and it seems silly to throw that instance away when we're only going to recreate it later. If you really don't like the idea of modifying the list parameter I suppose we could change the sig to List validate(List) (Although you should be aware that at least DefaultOption's process() method modifies it's ListIterator). Maybe calling it a Validator is incorrect then. I had thought of changing the method to return a List but then it is no longer a validation method, it is a validation and conversion method. We could modify the signature as follows: void validate(Option, List) The new values can be set on the Option rather than modifying the list. Or we could define a new interface that extends Validator with one method that returns a List (the object instances). So validators can implement Validator and validators/convertors can implement this new interface (not sure what name to give it). To avoid throwing away the newly created objects we could cache the results in the validate method and return them via the new method. I've started to ramble now so I should stop ;) -John K - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [math] Isn't it about time?
Brent Worden wrote: I am of the opinion that everything we've been discussing should be held over to the next release. No problem. The Decomposer could be added without incompatible changes itself, the only problem would be that in order to take full advantage, RealMatrix will have to be changed into an interface and a bunch of GeneralRealMatrix, TridiagonalRealMatrix, SymmetricRealMatrix and so on have to be added (only the first for a start). I'll try to get another shot at completing the documentation next week. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient NoHostHttpConnectionManager.java TestHttpConnection.java
olegk 2003/10/22 12:31:01 Modified:httpclient/src/java/org/apache/commons/httpclient HttpClient.java HttpConnection.java HttpConnectionManager.java HttpMethodBase.java HttpMethodDirector.java MultiThreadedHttpConnectionManager.java SimpleHttpConnectionManager.java httpclient/src/java/org/apache/commons/httpclient/methods/multipart PartBase.java httpclient/src/java/org/apache/commons/httpclient/params HttpMethodParams.java httpclient/src/test/org/apache/commons/httpclient NoHostHttpConnectionManager.java TestHttpConnection.java Log: PR #15435 (New Preferences Architecture) - HttpConnection HttpConnectionManager classes updated to take advantage of the new preference architecute. Contributed by Oleg Kalnichevski Reviewed by Michael Becke Revision ChangesPath 1.87 +16 -4 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java Index: HttpClient.java === RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v retrieving revision 1.86 retrieving revision 1.87 diff -u -r1.86 -r1.87 --- HttpClient.java 11 Oct 2003 19:46:51 - 1.86 +++ HttpClient.java 22 Oct 2003 19:31:00 - 1.87 @@ -161,6 +161,9 @@ if (this.httpConnectionManager == null) { this.httpConnectionManager = new SimpleHttpConnectionManager(); } +if (this.httpConnectionManager != null) { +this.httpConnectionManager.getParams().setDefaults(this.params); +} } /** @@ -184,6 +187,9 @@ } this.params = params; this.httpConnectionManager = httpConnectionManager; +if (this.httpConnectionManager != null) { +this.httpConnectionManager.getParams().setDefaults(this.params); +} } /** @@ -534,6 +540,9 @@ HttpConnectionManager httpConnectionManager ) { this.httpConnectionManager = httpConnectionManager; +if (this.httpConnectionManager != null) { +this.httpConnectionManager.getParams().setDefaults(this.params); +} } /** @@ -555,6 +564,9 @@ * @see HttpClientParams */ public void setParams(final HttpClientParams params) { +if (params == null) { +throw new IllegalArgumentException(Parameters may not be null); +} this.params = params; } 1.76 +121 -53 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpConnection.java Index: HttpConnection.java === RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpConnection.java,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- HttpConnection.java 10 Sep 2003 21:37:48 - 1.75 +++ HttpConnection.java 22 Oct 2003 19:31:00 - 1.76 @@ -74,6 +74,7 @@ import java.net.Socket; import java.net.SocketException; +import org.apache.commons.httpclient.params.HttpConnectionParams; import org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory; import org.apache.commons.httpclient.protocol.Protocol; import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; @@ -95,11 +96,19 @@ * /trtr *td[EMAIL PROTECTED] java.net.Socket#setTcpNoDelay(boolean)} *tdSO_NODELAY - *tdNone + *td[EMAIL PROTECTED] HttpConnectionParams#setTcpNoDelay(boolean)} * /trtr *td[EMAIL PROTECTED] java.net.Socket#setSoTimeout(int)} *tdSO_TIMEOUT - *td[EMAIL PROTECTED] #setConnectionTimeout(int)} + *td[EMAIL PROTECTED] HttpConnectionParams#setSoTimeout(int)} + * /trtr + *td[EMAIL PROTECTED] java.net.Socket#setSendBufferSize(int)} + *tdSO_SNDBUF + *td[EMAIL PROTECTED] HttpConnectionParams#setSendBufferSize(int)} + * /trtr + *td[EMAIL PROTECTED] java.net.Socket#setReceiveBufferSize(int)} + *tdSO_RCVBUF + *td[EMAIL PROTECTED] HttpConnectionParams#setReceiveBufferSize(int)} * /tr/table * * @author Rod Waldhoff @@ -393,7 +402,7 @@ * @return tttrue/tt if I am connected */ public boolean isOpen() { -if (used isStaleCheckingEnabled() isStale()) { +if (used this.params.isStaleCheckingEnabled() isStale()) { LOG.debug(Connection is stale, closing...); close(); } @@ -406,9 +415,12 @@ * @return codetrue/code
cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/params HttpConnectionManagerParams.java HttpConnectionParams.java
olegk 2003/10/22 12:35:34 Added: httpclient/src/java/org/apache/commons/httpclient/params HttpConnectionManagerParams.java HttpConnectionParams.java Log: PR #15435 (New Preferences Architecture) - HttpConnection HttpConnectionManager classes updated to take advantage of the new preference architecute. Contributed by Oleg Kalnichevski Reviewed by Michael Becke Revision ChangesPath 1.1 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/params/HttpConnectionManagerParams.java Index: HttpConnectionManagerParams.java === /* * $Header: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/params/HttpConnectionManagerParams.java,v 1.1 2003/10/22 19:35:33 olegk Exp $ * $Revision: 1.1 $ * $Date: 2003/10/22 19:35:33 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following 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/. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.commons.httpclient.params; /** * This class represents a collection of HTTP protocol parameters applicable to * [EMAIL PROTECTED] org.apache.commons.httpclient.HttpConnectionManager HTTP connection managers}. * Protocol parameters may be linked together to form a hierarchy. If a particular * parameter value has not been explicitly defined in the collection itself, its * value will be drawn from the parent collection of parameters. * * @author a href=mailto:[EMAIL PROTECTED]Oleg Kalnichevski/a * * @version $Revision: 1.1 $ */ public class HttpConnectionManagerParams extends HttpConnectionParams { } 1.1 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/params/HttpConnectionParams.java Index: HttpConnectionParams.java === /* * $Header: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/params/HttpConnectionParams.java,v 1.1 2003/10/22 19:35:33 olegk Exp $ * $Revision: 1.1 $ * $Date: 2003/10/22 19:35:33 $ * *
Re: [CLI] Validation (was 2.x Tasks)
- Original Message - From: John Keyes [EMAIL PROTECTED] To: Jakarta Commons Developers List [EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 7:50 PM Subject: Re: [CLI] Validation (was 2.x Tasks) snip/ I can definitely understand your thinking but it is a feature I thought was quiet handy too. In the example of DateValidator, checking the string is a valid date involves the creation of a Date object and it seems silly to throw that instance away when we're only going to recreate it later. If you really don't like the idea of modifying the list parameter I suppose we could change the sig to List validate(List) (Although you should be aware that at least DefaultOption's process() method modifies it's ListIterator). Maybe calling it a Validator is incorrect then. I had thought of changing the method to return a List but then it is no longer a validation method, it is a validation and conversion method. Yeah - the name is stretching the definition a bit. The loose justification in my head for DateValidator was it ensures the values are valid Date objects which sounded like validation. We could modify the signature as follows: void validate(Option, List) The new values can be set on the Option rather than modifying the list. Well it would need a CommandLine parameter too but it would work. Or we could define a new interface that extends Validator with one method that returns a List (the object instances). So validators can implement Validator and validators/convertors can implement this new interface (not sure what name to give it). To avoid throwing away the newly created objects we could cache the results in the validate method and return them via the new method. The word normalize has just hopped into my head. Does that cover validate and maybe convert to you? The caching approach would work but it seems a lot of work to get around a bad choice of name for the method/class. Rob I've started to ramble now so I should stop ;) -John K - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[RESULTS][VOTE][DBCP] Release DBCP v1.1
Voting results release DBCP v1.1: +0 __matthewHawthorne [EMAIL PROTECTED] +1 Dirk Verbeeck [EMAIL PROTECTED] +1 David Graham [EMAIL PROTECTED] +1 Serge Knystautas [EMAIL PROTECTED] +0 Gary Gregory [EMAIL PROTECTED] +1 John McNally [EMAIL PROTECTED] +1 Glenn Nielsen [EMAIL PROTECTED] The release was tagged in CVS as DBCP_1_1 on 20 Oktober. Noel J. Bergman [EMAIL PROTECTED] validated the official build. -- Dirk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[RESULTS][VOTE][Pool] Release Pool v1.1
Voting results release Pool v1.1: +0 __matthewHawthorne [EMAIL PROTECTED] +1 Dirk Verbeeck [EMAIL PROTECTED] +1 Shapira, Yoav [EMAIL PROTECTED] +0 David Graham [EMAIL PROTECTED] +0 Serge Knystautas [EMAIL PROTECTED] +0 Gary Gregory [EMAIL PROTECTED] +1 John McNally [EMAIL PROTECTED] The release was tagged in CVS as POOL_1_1 on 20 Oktober. Noel J. Bergman [EMAIL PROTECTED] validated the official build. -- Dirk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [lang] [PATCH] StringUtils.getLevenshteinDistance() fix for OutOfMemoryError when used with LONG strings
Cool. Sounds good and I'll have a go at applying your patch. Any chance of you submitting your other unit tests for the class? Hen On Wed, 22 Oct 2003, Chas Emerick wrote: I've never submitted a patch for an open-source project before (never got around to it lo these many years I guess), so I apologize for any errors in form or convention that I commit. I was planning on using the StringUtils.getLevenshteinDistance(String,String) method in a particular circumstance where I needed to get the edit distance between two large strings (anywhere between 10K - 500K characters each). However, I found that calling that method (as of v2.0 of commons-lang) would result in an OutOfMemoryError when strings of such lengths were provided. A quick look at the source revealed that the current implementation (which uses the sample impl. at http://www.merriampark.com/ld.htm) creates a matrix with dimensions corresponding to the lengths of the two strings provided. Clearly, a 100K x 100K int[] is problematic. Therefore, I've (mostly) rewritten the method using a two int arrays of the size of the first string's length, and the method now works properly with larger strings (beastly slow, but that's quadratic algorithms for you) . I've tested the new implementation against the ten or so testcases mentioned in the javadocs, as well as another half-dozen of my own, and everything looks good. If my mail client botches the patch diff, you can get it at http://www.snowtide.com/commons-lang-LDpatch.txt Chas Emerick | [EMAIL PROTECTED] http://www.snowtide.com Snowtide Informatics Systems, Inc. == --- StringUtils.java.oldWed Oct 22 12:58:04 2003 +++ StringUtils.javaWed Oct 22 13:51:36 2003 @@ -4255,8 +4255,8 @@ * another, where each change is a single character modification (deletion, * insertion or substitution)./p * - * pThis implementation of the Levenshtein distance algorithm - * is from a href=http://www.merriampark.com/ld.htm;http://www.merriampark.com/ld. htm/a/p + * pThis implementation of the Levenshtein distance algorithm was originally based upon the one + * presented at a href=http://www.merriampark.com/ld.htm;http://www.merriampark.co m/ld.htm/a/p * * pre * StringUtils.getLevenshteinDistance(null, *) = IllegalArgumentException @@ -4281,76 +4281,64 @@ if (s == null || t == null) { throw new IllegalArgumentException(Strings must not be null); } -int d[][]; // matrix -int n; // length of s -int m; // length of t -int i; // iterates through s -int j; // iterates through t -char s_i; // ith character of s -char t_j; // jth character of t -int cost; // cost - -// Step 1 -n = s.length(); -m = t.length(); + + /* + The difference between this impl. and the previous is that, rather than cr eating and retaining a matrix of size + s.length()+1 by t.length()+1, we maintain two single-dimensional arrays of length s.length()+1. The first, d, + is the 'current working' distance array that maintains the newest distance cost counts as we iterate through + the characters of String s. Each time we increment the index of String t we are comparing, d is copied to p, + the second int[]. Doing so allows us to retain the previous cost counts a s required by the algorithm + (taking the minimum of the cost count to the left, up one, and diagonally up and to the left of the current + cost count being calculated). (Note that the arrays aren't really copied anymore, just switched...this is clearly much + better than cloning an array or doing a System.arraycopy() each time throu gh the outer loop.) + + Effectively, the difference between the two implementations is this one do es not cause an out of memory condition + when calculating the LD over two very large strings. + */ + +int n = s.length(); // length of s +int m = t.length(); // length of t + if (n == 0) { return m; -} -if (m == 0) { +} else if (m == 0) { return n; } -d = new int[n + 1][m + 1]; -// Step 2 -for (i = 0; i = n; i++) { -d[i][0] = i; -} +int p[] = new int[n+1]; //'previous' cost array, horizontally +int d[] = new int[n+1]; // cost array, horizontally + int _d[]; //placeholder to assist in swapping p and d -for (j = 0; j = m; j++) { -d[0][j] = j; -} - -// Step 3 -for (i = 1; i = n; i++) { -
Re: [math] Complex implementation
As an answer to the thread mentioned, it suggests that two implementations of the Complex number functionality are available: 1) VNI's. 2) Colt's. This is no longer true, and the reason for me starting this thread. VNI no longer have their implementation online and the url provided in the email thread no longer takes you to the javadoc. This is made worse by the fact that Colt's implementation is in fact nothing but the VNI implementation. There is 1 implementation from 2 sources, the original of which just shut up shop. I agree with Roger Endo on Complex number usage. We're using it in FFT's amongst other places. So I'm left with Colt. This has legal problems. While VNI's licence is unspecified, Colt includes GPL licenced works. So this rules it out for some uses. In fact, as people here at work are starting to suggest applets rather than flash interfaces, I could be facing a situation in which I cannot download a fresh Complex number implementation which I can legally use. I see no reason not to go with Phil's classes, unless it's to ask VNI if they'd like to submit their popular Complex class. Hen On Wed, 22 Oct 2003, Mark R. Diggory wrote: I'm going to start a list of references to these threads in the xdoc, so we can always get back to it from the home page. When people have questions about the decisions and issues about complex, we'll be able to point them at the history of discussion on the topic. -Mark Brent Worden wrote: Here's the previous complex thread is was referring to http://nagoya.apache.org/eyebrowse/ReadMsg?listId=15msgNo=28132 Brent Worden http://www.brent.worden.org -Original Message- From: Brent Worden [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 21, 2003 10:53 PM To: Jakarta Commons Developers List Subject: RE: [math] Complex implementation I know we've talked about this before, It's not fresh in my mind why we decided against it. -Mark Looking back at the mail archives, it appears we decided against a complex class mainly for two reasons: 1) Not too many RW applications warrant a complex class and can be accommodated with two double values. 2) There are plenty of other OS, complex implementations available so it wasn't crucial to having one in commons-math. Brent Worden http://www.brent.worden.org - 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] -- Mark Diggory Software Developer Harvard MIT Data Center http://www.hmdc.harvard.edu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/xdocs components.xml
dirkv 2003/10/22 14:28:06 Modified:xdocscomponents.xml Log: Release Pool DBCP v1.1 Revision ChangesPath 1.100 +14 -7 jakarta-commons/xdocs/components.xml Index: components.xml === RCS file: /home/cvs/jakarta-commons/xdocs/components.xml,v retrieving revision 1.99 retrieving revision 1.100 diff -u -r1.99 -r1.100 --- components.xml21 Oct 2003 04:42:31 - 1.99 +++ components.xml22 Oct 2003 21:28:06 - 1.100 @@ -94,13 +94,16 @@ !-- /Collections -- !-- DBCP -- -dtbbiga href=http://cvs.apache.org/viewcvs/jakarta-commons/dbcp/;DBCP/a/big/b/dt +dtbbiga href=http://jakarta.apache.org/commons/dbcp/;DBCP/a/big/b/dt dd Commons-DBCP provides database connection pooling services. br/ Releases: + (a href=http://jakarta.apache.org/site/binindex.cgi#commons-dbcp;binary/a, + a href=http://jakarta.apache.org/site/sourceindex.cgi#commons-dbcp;source/a) ul - lia href=http://jakarta.apache.org/builds/jakarta-commons/release/commons-dbcp/v1.0/;Release 1.0/a - 12 Aug 2002/li + liVersion 1.1 - 20 October 2003/li + liVersion 1.0 - 12 August 2002/li /ul /dd !-- /DBCP -- @@ -267,14 +270,18 @@ !-- /Net -- !-- Pool -- -dtbbiga href=./pool/index.htmlPool/a/big/b/dt +dtbbiga href=http://jakarta.apache.org/commons/pool/;Pool/a/big/b/dt dd Commons-Pool provides a generic object pooling interface, a toolkit for creating modular object pools, and several general purpose pool implementations. - Releases: - ul - lia href=http://jakarta.apache.org/builds/jakarta-commons/release/commons-pool/v1.0.1/;Release 1.0.1/a - 12 Aug 2002/li - lia href=http://jakarta.apache.org/builds/jakarta-commons/release/commons-pool/v1.0/;Release 1.0/a - 4 May 2002/li + br/ + Releases: + (a href=http://jakarta.apache.org/site/binindex.cgi#commons-pool;binary/a, + a href=http://jakarta.apache.org/site/sourceindex.cgi#commons-pool;source/a) + ul + liRelease 1.1 - 20 October 2003/li + liRelease 1.0.1 - 12 August 2002/li + liRelease 1.0 - 4 May 2002/li /ul /dd !-- /Pool -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/docs components.html
dirkv 2003/10/22 14:28:38 Modified:docs components.html Log: Release Pool DBCP v1.1 Revision ChangesPath 1.124 +14 -7 jakarta-commons/docs/components.html Index: components.html === RCS file: /home/cvs/jakarta-commons/docs/components.html,v retrieving revision 1.123 retrieving revision 1.124 diff -u -r1.123 -r1.124 --- components.html 21 Oct 2003 21:36:42 - 1.123 +++ components.html 22 Oct 2003 21:28:38 - 1.124 @@ -303,13 +303,16 @@ !-- /Collections -- !-- DBCP -- -dtbbiga href=http://cvs.apache.org/viewcvs/jakarta-commons/dbcp/;DBCP/a/big/b/dt +dtbbiga href=http://jakarta.apache.org/commons/dbcp/;DBCP/a/big/b/dt dd Commons-DBCP provides database connection pooling services. br / Releases: + (a href=http://jakarta.apache.org/site/binindex.cgi#commons-dbcp;binary/a, + a href=http://jakarta.apache.org/site/sourceindex.cgi#commons-dbcp;source/a) ul - lia href=http://jakarta.apache.org/builds/jakarta-commons/release/commons-dbcp/v1.0/;Release 1.0/a - 12 Aug 2002/li + liVersion 1.1 - 20 October 2003/li + liVersion 1.0 - 12 August 2002/li /ul /dd !-- /DBCP -- @@ -476,14 +479,18 @@ !-- /Net -- !-- Pool -- -dtbbiga href=./pool/index.htmlPool/a/big/b/dt +dtbbiga href=http://jakarta.apache.org/commons/pool/;Pool/a/big/b/dt dd Commons-Pool provides a generic object pooling interface, a toolkit for creating modular object pools, and several general purpose pool implementations. - Releases: - ul - lia href=http://jakarta.apache.org/builds/jakarta-commons/release/commons-pool/v1.0.1/;Release 1.0.1/a - 12 Aug 2002/li - lia href=http://jakarta.apache.org/builds/jakarta-commons/release/commons-pool/v1.0/;Release 1.0/a - 4 May 2002/li + br / + Releases: + (a href=http://jakarta.apache.org/site/binindex.cgi#commons-pool;binary/a, + a href=http://jakarta.apache.org/site/sourceindex.cgi#commons-pool;source/a) + ul + liRelease 1.1 - 20 October 2003/li + liRelease 1.0.1 - 12 August 2002/li + liRelease 1.0 - 4 May 2002/li /ul /dd !-- /Pool -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils BeanListHandler.java
dgraham 2003/10/22 16:14:55 Removed: dbutils/src/java/org/apache/commons/dbutils BeanListHandler.java Log: Moved all ResultSetHandler implementations into new org.apache.commons.dbutils.handlers package because there are now enough of them to justify their own sub-package. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils MapHandler.java
dgraham 2003/10/22 16:15:39 Removed: dbutils/src/java/org/apache/commons/dbutils MapHandler.java Log: Moved all ResultSetHandler implementations into new org.apache.commons.dbutils.handlers package because there are now enough of them to justify their own sub-package. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils MapListHandler.java
dgraham 2003/10/22 16:15:58 Removed: dbutils/src/java/org/apache/commons/dbutils MapListHandler.java Log: Moved all ResultSetHandler implementations into new org.apache.commons.dbutils.handlers package because there are now enough of them to justify their own sub-package. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils ScalarHandler.java
dgraham 2003/10/22 16:16:09 Removed: dbutils/src/java/org/apache/commons/dbutils ScalarHandler.java Log: Moved all ResultSetHandler implementations into new org.apache.commons.dbutils.handlers package because there are now enough of them to justify their own sub-package. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils QueryRunner.java
dgraham 2003/10/22 16:25:02 Modified:dbutils/src/java/org/apache/commons/dbutils QueryRunner.java Log: Removed references to ResultSetMetaDataHandler. Revision ChangesPath 1.8 +382 -520 jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/QueryRunner.java Index: QueryRunner.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/QueryRunner.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- QueryRunner.java 22 Oct 2003 02:10:23 - 1.7 +++ QueryRunner.java 22 Oct 2003 23:25:01 - 1.8 @@ -66,9 +66,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; -import java.util.ArrayList; import java.util.Arrays; -import java.util.List; import javax.sql.DataSource; @@ -86,520 +84,384 @@ */ public class QueryRunner { -/** - * The DataSource to retrieve connections from. - */ -protected DataSource ds = null; - -/** - * Constructor for QueryRunner. - */ -public QueryRunner() { -super(); -} - -/** - * Constructor for QueryRunner. Methods that do not take a - * codeConnection/code parameter will retrieve connections from this - * codeDataSource/code. - * - * @param ds The codeDataSource/code to retrieve connections from. - */ -public QueryRunner(DataSource ds) { -super(); -this.ds = ds; -} - -/** - * Execute any SQL statement and return all the results in an - * codeObject[]/code. Callers are responsible for connection cleanup. - * - * @param conn The connection to execute the query with. - * @param sql The SQL statement. - * @param params SQL replacement parameters; codenull/code if no - * parameters are required. - * @param rsh The handler to generate result objects with - * @param rsmdh Handles the meta data. - * @param userObject Object to pass to the handler. - * @return An array filled with result objects from the handler for each - * codeResultSet/code returned by the query; codenull/code if the - * statment was an UPDATE. - * @throws SQLException - */ -public Object[] execute( -Connection conn, -String sql, -Object[] params, -ResultSetHandler rsh, -ResultSetMetaDataHandler rsmdh, -Object userObject) -throws SQLException { - -PreparedStatement stmt = null; -ResultSet rs = null; - -List results = new ArrayList(); - -try { -stmt = conn.prepareStatement(sql); -this.fillStatement(stmt, params); - -if (!stmt.execute()) { -return null; -} - -do { -rs = stmt.getResultSet(); -if (rs != null) { -rs = this.wrap(rs); - -if (rsmdh != null) { -rsmdh.handle(rs.getMetaData()); -} - -results.add(rsh.handle(rs, params, userObject)); -} - -} while (stmt.getMoreResults()); - -} catch (SQLException e) { -rethrow(e, sql, params); - -} finally { -DbUtils.closeQuietly(rs); -DbUtils.closeQuietly(stmt); -} - -Object[] res = new Object[results.size()]; -return results.toArray(res); -} - -/** - * Fill the codePreparedStatement/code replacement parameters with - * the given objects. - * @param stmt - * @param params Query replacement parameters; codenull/code is a valid - * value to pass in. - * @throws SQLException - */ -protected void fillStatement(PreparedStatement stmt, Object[] params) -throws SQLException { - -if (params == null) { -return; -} - -for (int i = 0; i params.length; i++) { -if (params[i] != null) { -stmt.setObject(i + 1, params[i]); -} else { -stmt.setNull(i + 1, Types.OTHER); -} -} -} - -/** - * Returns the codeDataSource/code this runner is using. - */ -public DataSource getDataSource() { -return this.ds; -} - -/** - * Execute an SQL SELECT query with a single replacement parameter. The - * caller is responsible for connection cleanup. - * - * @param conn The connection to execute the query in. - * @param sql The query to execute. - * @param param The replacement parameter. - * @param rsh The
cvs commit: jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils ResultSetMetaDataHandler.java
dgraham 2003/10/22 16:25:29 Removed: dbutils/src/java/org/apache/commons/dbutils ResultSetMetaDataHandler.java Log: Removed references to ResultSetMetaDataHandler. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2 CommandLine.java
roxspring2003/10/22 16:27:58 Modified:cli/src/java/org/apache/commons/cli2 CommandLine.java Log: CommandLine instances can now be queried to find the Options present Revision ChangesPath 1.2 +11 -3 jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/CommandLine.java Index: CommandLine.java === RCS file: /home/cvs/jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/CommandLine.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- CommandLine.java 18 Oct 2003 22:00:06 - 1.1 +++ CommandLine.java 22 Oct 2003 23:27:58 - 1.2 @@ -225,4 +225,12 @@ return buffer.toString(); } + +public Set getOptions(){ +return Collections.unmodifiableSet(options); +} + +public Set getOptionTriggers(){ +return Collections.unmodifiableSet(nameToOption.keySet()); +} } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [lang] ToStringBuilder.reflectionToString() and statics.
Perhaps just on the ReflectionToStringBuilder? Or maybe have a diferent method name - toStringWithStatics() Stephen - Original Message - From: Gary Gregory [EMAIL PROTECTED] Hello, I have a case where I am working with an IBM class which holds values on the static side only. So I would like to be able to see these statics like so: ToStringBuilder.reflectionToString(MQEnvironment.class) or ReflectionToStringBuilder.toString(MQEnvironment.class) My question is: Does anyone object to having a boolean parameter to show statics (default false) like we have now for transients? Thanks, Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2 ArgumentImpl.java
roxspring2003/10/22 16:33:13 Modified:cli/src/java/org/apache/commons/cli2 ArgumentImpl.java Log: Uncommented the processValues(...) method as it was never supposed to be committed without it. Revision ChangesPath 1.4 +38 -38 jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/ArgumentImpl.java Index: ArgumentImpl.java === RCS file: /home/cvs/jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/ArgumentImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ArgumentImpl.java 21 Oct 2003 20:23:21 - 1.3 +++ ArgumentImpl.java 22 Oct 2003 23:33:13 - 1.4 @@ -65,6 +65,7 @@ import java.util.List; import java.util.ListIterator; import java.util.Set; +import java.util.StringTokenizer; import org.apache.commons.cli2.validation.InvalidArgumentException; import org.apache.commons.cli2.validation.Validator; @@ -136,40 +137,40 @@ /* (non-Javadoc) * @see org.apache.commons.cli2.Argument#processValues(org.apache.commons.cli2.CommandLine, java.util.ListIterator) */ -//public void processValues( -//final CommandLine commandLine, -//final ListIterator arguments) -//throws OptionException { -// -//commandLine.addOption(this); -//int argumentCount = commandLine.getValues(this).size(); -//while (arguments.hasNext() argumentCount maximum) { -// -//final String allValues = (String) arguments.next(); -// -//if (commandLine.looksLikeOption(allValues)) { -//arguments.previous(); -//break; -//} -// -//final StringTokenizer values = -//new StringTokenizer( -//allValues, -//String.valueOf(subsequentSepatator)); -// -//while (values.hasMoreTokens() argumentCount maximum) { -//++argumentCount; -//commandLine.addValue(this, values.nextToken()); -//} -//if (values.hasMoreTokens()) { -//throw new UnexpectedValueException(this, values.nextToken()); -//} -//} -// -//if (argumentCount minimum) { -//throw new MissingValueException(this); -//} -//} +public void processValues( +final CommandLine commandLine, +final ListIterator arguments) +throws OptionException { + +commandLine.addOption(this); +int argumentCount = commandLine.getValues(this).size(); +while (arguments.hasNext() argumentCount maximum) { + +final String allValues = (String) arguments.next(); + +if (commandLine.looksLikeOption(allValues)) { +arguments.previous(); +break; +} + +final StringTokenizer values = +new StringTokenizer( +allValues, +String.valueOf(subsequentSepatator)); + +while (values.hasMoreTokens() argumentCount maximum) { +++argumentCount; +commandLine.addValue(this, values.nextToken()); +} +if (values.hasMoreTokens()) { +throw new UnexpectedValueException(this, values.nextToken()); +} +} + +if (argumentCount minimum) { +throw new MissingValueException(this); +} +} /* (non-Javadoc) * @see org.apache.commons.cli2.Argument#getName() @@ -186,7 +187,6 @@ if (initialSplit) { - final String argument = (String)args.next(); final int initialIndex = argument.indexOf(initialSeparator); if (initialIndex 0) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils ResultSetHandler.java QueryRunner.java
dgraham 2003/10/22 16:33:25 Modified:dbutils/src/java/org/apache/commons/dbutils/handlers MapHandler.java BeanListHandler.java BeanHandler.java MapListHandler.java ScalarHandler.java ArrayListHandler.java ArrayHandler.java dbutils/src/java/org/apache/commons/dbutils ResultSetHandler.java QueryRunner.java Log: Changed ResultSetHandler.handle() back to only accepting a ResultSet parameter. The other parameters were no longer needed. Revision ChangesPath 1.2 +42 -44 jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/handlers/MapHandler.java Index: MapHandler.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/handlers/MapHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MapHandler.java 22 Oct 2003 23:13:43 - 1.1 +++ MapHandler.java 22 Oct 2003 23:33:25 - 1.2 @@ -77,47 +77,45 @@ * @author David Graham */ public class MapHandler implements ResultSetHandler { - -/** - * The RowProcessor implementation to use when converting rows - * into Maps. - */ -private RowProcessor convert = BasicRowProcessor.instance(); - -/** - * Creates a new instance of MapHandler using a - * codeBasicRowProcessor/code for conversion. - */ -public MapHandler() { -super(); -} - -/** - * Creates a new instance of MapHandler. - * - * @param convert The codeRowProcessor/code implementation - * to use when converting rows into Maps. - */ -public MapHandler(RowProcessor convert) { -super(); -this.convert = convert; -} -/** - * Converts the first row in the codeResultSet/code into a - * codeMap/code. - * - * @return A codeMap/code with the values from the first row or - * codenull/code if there are no rows in the codeResultSet/code. - * - * @throws SQLException - * - * @see org.apache.commons.dbutils.ResultSetHandler#handle(java.sql.ResultSet, java.lang.Object[], java.lang.Object) - */ -public Object handle(ResultSet rs, Object[] params, Object userObject) -throws SQLException { + /** + * The RowProcessor implementation to use when converting rows + * into Maps. + */ + private RowProcessor convert = BasicRowProcessor.instance(); -return rs.next() ? this.convert.toMap(rs) : null; -} + /** + * Creates a new instance of MapHandler using a + * codeBasicRowProcessor/code for conversion. + */ + public MapHandler() { + super(); + } + + /** + * Creates a new instance of MapHandler. + * + * @param convert The codeRowProcessor/code implementation + * to use when converting rows into Maps. + */ + public MapHandler(RowProcessor convert) { + super(); + this.convert = convert; + } + + /** + * Converts the first row in the codeResultSet/code into a + * codeMap/code. + * + * @return A codeMap/code with the values from the first row or + * codenull/code if there are no rows in the codeResultSet/code. + * + * @throws SQLException + * + * @see org.apache.commons.dbutils.ResultSetHandler#handle(java.sql.ResultSet) + */ + public Object handle(ResultSet rs) throws SQLException { + return rs.next() ? this.convert.toMap(rs) : null; + } } 1.2 +50 -52 jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/handlers/BeanListHandler.java Index: BeanListHandler.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/handlers/BeanListHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- BeanListHandler.java 22 Oct 2003 23:13:43 - 1.1 +++ BeanListHandler.java 22 Oct 2003 23:33:25 - 1.2 @@ -79,54 +79,52 @@ */ public class BeanListHandler implements ResultSetHandler { -/** - * The Class of beans produced by this handler. - */ -private Class type = null; - -/** - * The RowProcessor implementation to use when converting rows - * into beans. - */ -private RowProcessor convert = BasicRowProcessor.instance(); + /** + * The Class of beans produced by this handler. + */ + private Class type = null; -/** -
cvs commit: jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2 ParentImpl.java
roxspring2003/10/22 16:34:42 Modified:cli/src/java/org/apache/commons/cli2 ParentImpl.java Log: Added getArgument() and getChildren() methods to ParentImpl so that subclasses can access the information Revision ChangesPath 1.2 +19 -3 jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/ParentImpl.java Index: ParentImpl.java === RCS file: /home/cvs/jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/ParentImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ParentImpl.java 18 Oct 2003 22:00:14 - 1.1 +++ ParentImpl.java 22 Oct 2003 23:34:42 - 1.2 @@ -206,4 +206,20 @@ return helpLines; } +/** + * @return Returns the argument. + */ +public Argument getArgument() +{ +return argument; +} + +/** + * @return Returns the children. + */ +public Group getChildren() +{ +return children; +} + } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [lang] ToStringBuilder.reflectionToString() and statics.
+1 ReflectionToStringBuilder but I am not fond of a toStringWithStatics() since we already have options like transient output in a boolean parameter and not method names. I should be able to ask ReflectionToStringBuilder for transients AND statics. Gary -Original Message- From: Stephen Colebourne [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 16:35 To: Jakarta Commons Developers List Subject: Re: [lang] ToStringBuilder.reflectionToString() and statics. Perhaps just on the ReflectionToStringBuilder? Or maybe have a diferent method name - toStringWithStatics() Stephen - Original Message - From: Gary Gregory [EMAIL PROTECTED] Hello, I have a case where I am working with an IBM class which holds values on the static side only. So I would like to be able to see these statics like so: ToStringBuilder.reflectionToString(MQEnvironment.class) or ReflectionToStringBuilder.toString(MQEnvironment.class) My question is: Does anyone object to having a boolean parameter to show statics (default false) like we have now for transients? Thanks, Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [lang] ToStringBuilder.reflectionToString() and statics.
OK, lets hope we don't get too many boolean flags... Stephen - Original Message - From: Gary Gregory [EMAIL PROTECTED] To: 'Jakarta Commons Developers List' [EMAIL PROTECTED] Sent: Thursday, October 23, 2003 12:35 AM Subject: RE: [lang] ToStringBuilder.reflectionToString() and statics. +1 ReflectionToStringBuilder but I am not fond of a toStringWithStatics() since we already have options like transient output in a boolean parameter and not method names. I should be able to ask ReflectionToStringBuilder for transients AND statics. Gary -Original Message- From: Stephen Colebourne [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 16:35 To: Jakarta Commons Developers List Subject: Re: [lang] ToStringBuilder.reflectionToString() and statics. Perhaps just on the ReflectionToStringBuilder? Or maybe have a diferent method name - toStringWithStatics() Stephen - Original Message - From: Gary Gregory [EMAIL PROTECTED] Hello, I have a case where I am working with an IBM class which holds values on the static side only. So I would like to be able to see these statics like so: ToStringBuilder.reflectionToString(MQEnvironment.class) or ReflectionToStringBuilder.toString(MQEnvironment.class) My question is: Does anyone object to having a boolean parameter to show statics (default false) like we have now for transients? Thanks, Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2 DefaultOption.java
roxspring2003/10/22 16:48:32 Modified:cli/src/java/org/apache/commons/cli2 DefaultOption.java Log: DefaultOption now allows options with arguments immediately following the short option, just as I thought it always had done. E.g. -Flogfile has an option -F and argument logfile Revision ChangesPath 1.3 +12 -5 jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/DefaultOption.java Index: DefaultOption.java === RCS file: /home/cvs/jakarta-commons-sandbox/cli/src/java/org/apache/commons/cli2/DefaultOption.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DefaultOption.java21 Oct 2003 19:28:14 - 1.2 +++ DefaultOption.java22 Oct 2003 23:48:32 - 1.3 @@ -154,8 +154,15 @@ //HMM test bursting all vs bursting one by one. arguments.set(preferredName); - arguments.add(shortPrefix + argument.substring(burstLength)); - arguments.previous(); + +if(getArgument()==null){ +arguments.add(shortPrefix + argument.substring(burstLength)); +} +else{ +arguments.add(argument.substring(burstLength)); +} + +arguments.previous(); } else { throw new BurstException(this, argument); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils ResultSetIteratorTest.java MockResultSet.java
dgraham 2003/10/22 16:54:53 Modified:dbutils/src/test/org/apache/commons/dbutils MockResultSet.java Added: dbutils/src/test/org/apache/commons/dbutils ResultSetIteratorTest.java Log: Added ResultSetIteratorTest. Revision ChangesPath 1.2 +91 -66 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/MockResultSet.java Index: MockResultSet.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/MockResultSet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockResultSet.java22 Oct 2003 04:16:04 - 1.1 +++ MockResultSet.java22 Oct 2003 23:54:53 - 1.2 @@ -75,72 +75,97 @@ */ class MockResultSet implements InvocationHandler { -private Object[] rows = null; + private Object[] rows = null; -private ResultSetMetaData metaData = null; + private ResultSetMetaData metaData = null; -private Iterator iter = null; + private Iterator iter = null; -private Object[] currentRow = null; + private Object[] currentRow = null; -private Boolean wasNull = Boolean.FALSE; - -/** - * Create a codeMockResultSet/code proxy object. This is equivalent to: - * pre - * ProxyFactory.instance().createResultSet(new MockResultSet(metaData, rows)); - * /pre - * - * @param metaData - * @param rows - * @return - */ -public static ResultSet create(ResultSetMetaData metaData, Object[][] rows) { -return ProxyFactory.instance().createResultSet( -new MockResultSet(metaData, rows)); -} - -public MockResultSet(ResultSetMetaData metaData, Object[][] rows) { -super(); -this.metaData = metaData; -this.rows = rows; -this.iter = Arrays.asList(rows).iterator(); -} - -public Object invoke(Object proxy, Method method, Object[] args) -throws Throwable { - -String methodName = method.getName(); - -if (methodName.equals(getMetaData)) { -return this.metaData; - -} else if (methodName.equals(next)) { -if (!iter.hasNext()) { -return Boolean.FALSE; -} else { -this.currentRow = (Object[]) iter.next(); -return Boolean.TRUE; -} - -} else if (methodName.equals(previous)) { - -} else if (methodName.equals(close)) { - -} else if (methodName.equals(getObject)) { -int col = ((Integer) args[0]).intValue() - 1; - -Object obj = this.currentRow[col]; -if (obj == null) { -this.wasNull = (obj == null) ? Boolean.TRUE : Boolean.FALSE; -} - -return obj; - -} else if (methodName.equals(wasNull)) { -return this.wasNull; -} - -return null; -} + private Boolean wasNull = Boolean.FALSE; + + /** + * Create a codeMockResultSet/code proxy object. This is equivalent to: + * pre + * ProxyFactory.instance().createResultSet(new MockResultSet(metaData, rows)); + * /pre + * + * @param metaData + * @param rows + * @return + */ + public static ResultSet create( + ResultSetMetaData metaData, + Object[][] rows) { + + return ProxyFactory.instance().createResultSet( + new MockResultSet(metaData, rows)); + } + + public MockResultSet(ResultSetMetaData metaData, Object[][] rows) { + super(); + this.metaData = metaData; + this.rows = rows; + this.iter = Arrays.asList(rows).iterator(); + } + + public Object invoke(Object proxy, Method method, Object[] args) + throws Throwable { + + String methodName = method.getName(); + + if (methodName.equals(getMetaData)) { + return this.getMetaData(); + + } else if (methodName.equals(next)) { + return this.next(); + + } else if (methodName.equals(previous)) { + + } else if (methodName.equals(close)) { + + } else if (methodName.equals(getObject)) { + int col = ((Integer) args[0]).intValue() - 1; + return this.getObject(col); + + } else if (methodName.equals(wasNull)) { + return this.wasNull(); + + } else if (methodName.equals(isLast)) { + return this.isLast(); + } + +
cvs commit: jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2 PrecedenceTest.java
roxspring2003/10/22 16:58:29 Added: cli/src/test/org/apache/commons/cli2 PrecedenceTest.java Log: Added tests for the precedence of options in different combinations. Some of the tests fail and have been prefixed X so that the failure is hidden until we decide whether to fix the test or the code. Revision ChangesPath 1.1 jakarta-commons-sandbox/cli/src/test/org/apache/commons/cli2/PrecedenceTest.java Index: PrecedenceTest.java === /* * Created on 22-Oct-2003 * * To change the template for this generated file go to * Window - Preferences - Java - Code Generation - Code and Comments */ package org.apache.commons.cli2; import java.util.Arrays; import java.util.List; import java.util.Set; import junit.framework.TestCase; /** * @author Rob Oxspring * * To change the template for this generated type comment go to * Window - Preferences - Java - Code Generation - Code and Comments */ public class PrecedenceTest extends TestCase { private final String[] args = new String[] { -file }; public void testSimple() throws OptionException { final DefaultOptionBuilder oBuilder = new DefaultOptionBuilder(); final Group options = new GroupBuilder() .withOption(oBuilder.withShortName(file).create()) .create(); final CommandLine cl = buildCommandLine(options, args); assertEquals(new String[] { -file }, cl); } public void testArgument() throws OptionException { final DefaultOptionBuilder oBuilder = new DefaultOptionBuilder(); final ArgumentBuilder aBuilder = new ArgumentBuilder(); final Group options = new GroupBuilder() .withOption( oBuilder .withShortName(f) .withArgument(aBuilder.create()) .create()) .create(); final CommandLine cl = buildCommandLine(options, args); assertEquals(new String[] { -f }, cl); } public void testBurst() throws OptionException { final DefaultOptionBuilder oBuilder = new DefaultOptionBuilder(); final GroupBuilder gBuilder = new GroupBuilder(); final Group options = gBuilder .withOption(oBuilder.withShortName(f).create()) .withOption(oBuilder.withShortName(i).create()) .withOption(oBuilder.withShortName(l).create()) .withOption(oBuilder.withShortName(e).create()) .create(); final CommandLine cl = buildCommandLine(options, args); assertEquals(new String[] { -f, -i, -l, -e }, cl); } public void testChildren() throws OptionException { final DefaultOptionBuilder oBuilder = new DefaultOptionBuilder(); final GroupBuilder gBuilder = new GroupBuilder(); final Group children = gBuilder .withOption(oBuilder.withShortName(i).create()) .withOption(oBuilder.withShortName(l).create()) .withOption(oBuilder.withShortName(e).create()) .create(); final Group options = gBuilder .withOption( oBuilder .withShortName(f) .withChildren(children) .create()) .create(); final CommandLine cl = buildCommandLine(options, args); assertEquals(new String[] { -f, -i, -l, -e }, cl); } public void XtestSimpleVsArgument() throws OptionException { final DefaultOptionBuilder oBuilder = new DefaultOptionBuilder(); final GroupBuilder gBuilder = new GroupBuilder(); final ArgumentBuilder aBuilder = new ArgumentBuilder(); final Group options = gBuilder .withOption(oBuilder.withShortName(file).create()) .withOption( oBuilder .withShortName(f) .withArgument(aBuilder.create()) .create()) .create(); final CommandLine cl = buildCommandLine(options, args); assertEquals(new String[] { -f }, cl); } public void XtestSimpleVsBurst() throws OptionException { final DefaultOptionBuilder oBuilder = new DefaultOptionBuilder(); final GroupBuilder gBuilder = new GroupBuilder(); final Group options = gBuilder .withOption(oBuilder.withShortName(file).create()) .withOption(oBuilder.withShortName(f).create())
cvs commit: jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils DbUtils.java
dgraham 2003/10/22 17:01:47 Modified:dbutils/src/java/org/apache/commons/dbutils/driver DriverWrapper.java dbutils/src/java/org/apache/commons/dbutils DbUtils.java Log: Renamed ensureLoaded() to more descriptive loadDriver(). Also improved the name of the parameter to make things more self explanatory. Revision ChangesPath 1.4 +5 -5 jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/driver/DriverWrapper.java Index: DriverWrapper.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/driver/DriverWrapper.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- DriverWrapper.java19 Oct 2003 20:20:06 - 1.3 +++ DriverWrapper.java23 Oct 2003 00:01:47 - 1.4 @@ -120,7 +120,7 @@ } String classname = url.substring(0, idx); -DbUtils.ensureLoaded(classname); +DbUtils.loadDriver(classname); url = url.substring(idx + 1); @@ -149,7 +149,7 @@ } String classname = url.substring(0, idx); -DbUtils.ensureLoaded(classname); +DbUtils.loadDriver(classname); url = url.substring(idx + 1); 1.40 +31 -31 jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/DbUtils.java Index: DbUtils.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/DbUtils.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- DbUtils.java 19 Oct 2003 19:21:30 - 1.39 +++ DbUtils.java 23 Oct 2003 00:01:47 - 1.40 @@ -174,35 +174,35 @@ } /** - * Ensures that a database driver class is loaded. - * If this succeeds, then it returns true, else it returns false. + * Loads and registers a database driver class. + * If this succeeds, it returns true, else it returns false. */ -public static boolean ensureLoaded(String name) { -try { -Class.forName(name).newInstance(); -return true; + public static boolean loadDriver(String driverClassName) { + try { + Class.forName(driverClassName).newInstance(); + return true; -} catch (ClassNotFoundException e) { -// TODO Logging? -//e.printStackTrace(); -return false; + } catch (ClassNotFoundException e) { + // TODO Logging? + //e.printStackTrace(); + return false; -} catch (IllegalAccessException e) { -// TODO Logging? -//e.printStackTrace(); + } catch (IllegalAccessException e) { + // TODO Logging? + //e.printStackTrace(); -// Constructor is private, OK for DriverManager contract -return true; + // Constructor is private, OK for DriverManager contract + return true; -} catch (InstantiationException e) { -// TODO Logging? -//e.printStackTrace(); -return false; + } catch (InstantiationException e) { + // TODO Logging? + //e.printStackTrace(); + return false; -} catch (Throwable t) { -return false; -} -} + } catch (Throwable t) { + return false; + } + } public static void printStackTrace(SQLException sqle) { printStackTrace(sqle, new PrintWriter(System.err)); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils ProxyFactoryTest.java
dgraham 2003/10/22 17:10:37 Added: dbutils/src/test/org/apache/commons/dbutils ProxyFactoryTest.java Log: Added ProxyFactoryTest. Revision ChangesPath 1.1 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/ProxyFactoryTest.java Index: ProxyFactoryTest.java === /* * $Header: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/ProxyFactoryTest.java,v 1.1 2003/10/23 00:10:37 dgraham Exp $ * $Revision: 1.1 $ * $Date: 2003/10/23 00:10:37 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowledgement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowledgement may appear in the software itself, *if and wherever such third-party acknowledgements normally appear. * * 4. The names The Jakarta Project, Commons, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * */ package org.apache.commons.dbutils; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.sql.Connection; import java.sql.Driver; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.Statement; import junit.framework.TestCase; /** * ProxyFactoryTest performs simple type checking on proxy objects returned * from a ProxyFactory. * * @author David Graham */ public class ProxyFactoryTest extends TestCase { private static final InvocationHandler stub = new InvocationHandler() { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return null; } }; /** * Constructor for ProxyFactoryTest. */ public ProxyFactoryTest(String name) { super(name); } public void testCreateConnection() { assertTrue( ProxyFactory.instance().createConnection(stub) instanceof Connection); } public void testCreateDriver() { assertTrue( ProxyFactory.instance().createDriver(stub) instanceof Driver); } public void testCreatePreparedStatement() { assertTrue( ProxyFactory.instance().createPreparedStatement(stub) instanceof
Re: sandbox 'article'
John, I don't think anyone would be disturbed or offended if you did all of your CLI development work in HEAD in /jakarta-commons/cli. It actually might be less confusing to people looking to contribute. In other words, once a project is promoted, keep the development in Commons proper. I'm only making this suggestion because rolling things back over to sandbox, and then copying version over to commons proper complicates CVS history - and, the assumption is that every release will get a branch. Tim On Tue, 2003-10-21 at 09:12, Henri Yandell wrote: Added to a category of 'development fork'. I think it's fine to use sandbox for this. The other option would be to create a cvs branch in the proper cvs. Hen On 21 Oct 2003, John Keyes wrote: CLI is back in the sandbox for it's version 2 development. Does this go against what the sandbox was intended for? The main reason to head back to the sandbox is that 2 is vastly different to 1 and the majority of the code has been written by Rob Oxspring (who does not have karma for commons). So myself and Rob thought it would be good to head back to the sandbox to muck around and get this code heading in the direction of a release (and also to get to know each other's strengths and weaknesses). So it is active but is also promoted! -John K On Tue, 2003-10-21 at 14:27, Henri Yandell wrote: I was rambling through the sandbox and wrote up some notes. I'd like to post the url to the users list, but first wanted to see if anyone on the dev list had any views on it: http://www.generationjava.com/article/apache/StateOfTheSandbox.shtml Most importantly I need suggestions on whether projects are in the wrong category, or I have facts/names wrong. Hen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- John Keyes [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- - Tim O'Brien - [EMAIL PROTECTED] - (847) 863-7045 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils QueryRunner.java
dgraham 2003/10/22 17:28:38 Modified:dbutils/src/java/org/apache/commons/dbutils QueryRunner.java Log: javadoc fixes, cast null parameters to make sure we call the correct method, always call DbUtils.closeQuietly() instead of DbUtils.close() in finally blocks so we don't lose a more interesting exception that occurred in the try block. Revision ChangesPath 1.10 +28 -19 jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/QueryRunner.java Index: QueryRunner.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/QueryRunner.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- QueryRunner.java 22 Oct 2003 23:33:25 - 1.9 +++ QueryRunner.java 23 Oct 2003 00:28:38 - 1.10 @@ -214,7 +214,7 @@ public Object query(Connection conn, String sql, ResultSetHandler rsh) throws SQLException { - return this.query(conn, sql, null, rsh); + return this.query(conn, sql, (Object[]) null, rsh); } /** @@ -223,9 +223,10 @@ * codeDataSource/code set in the constructor. * * @param sql The SQL statement to execute. + * @param param The replacement parameter. * @param rsh The handler used to create the result object from * the codeResultSet/code. - * @param param The replacement parameter. + * * @return An object generated by the handler. * @throws SQLException */ @@ -241,10 +242,12 @@ * codeDataSource/code set in the constructor. * * @param sql The SQL statement to execute. - * @param params Initialize the PreparedStatement's IN parameters with this - * array. + * @param params Initialize the PreparedStatement's IN parameters with + * this array. + * * @param rsh The handler used to create the result object from * the codeResultSet/code. + * * @return An object generated by the handler. * @throws SQLException */ @@ -259,7 +262,7 @@ result = this.query(conn, sql, params, rsh); } finally { - DbUtils.close(conn); + DbUtils.closeQuietly(conn); } return result; @@ -273,20 +276,24 @@ * @param sql The SQL statement to execute. * @param rsh The handler used to create the result object from * the codeResultSet/code. + * * @return An object generated by the handler. * @throws SQLException */ public Object query(String sql, ResultSetHandler rsh) throws SQLException { - return this.query(sql, null, rsh); + return this.query(sql, (Object[]) null, rsh); } /** * Throws a new exception with a more informative error message. + * * @param cause The original exception that will be chained to the new * exception when it's rethrown. + * * @param sql The query that was executing when the exception happened. * @param params The query replacement paramaters; codenull/code is a * valid value to pass in. + * * @throws SQLException */ protected void rethrow(SQLException cause, String sql, Object[] params) @@ -309,6 +316,7 @@ * database connections from. This should be called after creating a * runner with the default constructor if you intend to use the * execute methods without passing in a codeConnection/code. + * * @param dataSource The DataSource to use. */ public void setDataSource(DataSource dataSource) { @@ -325,7 +333,7 @@ * @throws SQLException */ public int update(Connection conn, String sql) throws SQLException { - return this.update(conn, sql, null); + return this.update(conn, sql, (Object[]) null); } /** @@ -346,6 +354,7 @@ /** * Execute an SQL INSERT, UPDATE, or DELETE query. + * * @param conn The connection to use to run the query. * @param sql The SQL to execute. * @param params The query replacement parameters. @@ -355,12 +364,13 @@ public int update(Connection conn, String sql, Object[] params) throws SQLException { - PreparedStatement stmt = conn.prepareStatement(sql); - this.fillStatement(stmt, params); - + PreparedStatement stmt = null; int rows = 0; try { + stmt = conn.prepareStatement(sql); + this.fillStatement(stmt, params);
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils MockResultSet.java
dgraham 2003/10/22 18:13:33 Modified:dbutils/src/test/org/apache/commons/dbutils MockResultSet.java Log: A null Object[][] indicates an empty result set. Revision ChangesPath 1.3 +15 -9 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/MockResultSet.java Index: MockResultSet.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/MockResultSet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MockResultSet.java22 Oct 2003 23:54:53 - 1.2 +++ MockResultSet.java23 Oct 2003 01:13:33 - 1.3 @@ -66,6 +66,7 @@ import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.util.Arrays; +import java.util.Collections; import java.util.Iterator; /** @@ -75,8 +76,6 @@ */ class MockResultSet implements InvocationHandler { - private Object[] rows = null; - private ResultSetMetaData metaData = null; private Iterator iter = null; @@ -92,22 +91,29 @@ * /pre * * @param metaData - * @param rows + * @param rows A null value indicates an empty codeResultSet/code. * @return */ public static ResultSet create( ResultSetMetaData metaData, Object[][] rows) { - + return ProxyFactory.instance().createResultSet( new MockResultSet(metaData, rows)); } +/** + * MockResultSet constructor. + * @param metaData + * @param rows A null value indicates an empty codeResultSet/code. + */ public MockResultSet(ResultSetMetaData metaData, Object[][] rows) { super(); this.metaData = metaData; - this.rows = rows; - this.iter = Arrays.asList(rows).iterator(); + this.iter = + (rows == null) + ? Collections.EMPTY_LIST.iterator() + : Arrays.asList(rows).iterator(); } public Object invoke(Object proxy, Method method, Object[] args) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers - New directory
dgraham 2003/10/22 18:15:30 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils BaseTestCase.java ResultSetIteratorTest.java BasicRowProcessorTest.java ProxyFactoryTest.java
dgraham 2003/10/22 18:15:34 Modified:dbutils/src/test/org/apache/commons/dbutils ResultSetIteratorTest.java BasicRowProcessorTest.java ProxyFactoryTest.java Added: dbutils/src/test/org/apache/commons/dbutils/handlers ArrayListHandlerTest.java ArrayHandlerTest.java dbutils/src/test/org/apache/commons/dbutils BaseTestCase.java Log: Added a BaseTestCase class that other tests should extend. This also acts as the all tests runner. Added tests for Array handler implementations. Revision ChangesPath 1.1 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers/ArrayListHandlerTest.java Index: ArrayListHandlerTest.java === /* * $Header: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers/ArrayListHandlerTest.java,v 1.1 2003/10/23 01:15:34 dgraham Exp $ * $Revision: 1.1 $ * $Date: 2003/10/23 01:15:34 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowledgement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowledgement may appear in the software itself, *if and wherever such third-party acknowledgements normally appear. * * 4. The names The Jakarta Project, Commons, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * */ package org.apache.commons.dbutils.handlers; import java.sql.SQLException; import java.util.Iterator; import java.util.List; import org.apache.commons.dbutils.BaseTestCase; import org.apache.commons.dbutils.ResultSetHandler; /** * ArrayListHandlerTest * * @author David Graham */ public class ArrayListHandlerTest extends BaseTestCase { /** * Constructor for ArrayListHandlerTest. */ public ArrayListHandlerTest(String name) { super(name); } public void testHandle() throws SQLException { ResultSetHandler h = new ArrayListHandler(); List results = (List) h.handle(this.rs); assertNotNull(results); assertEquals(2, results.size()); Iterator iter = results.iterator(); Object[] row = null; while (iter.hasNext()) { row = (Object[]) iter.next(); assertEquals(4, row.length); } assertEquals(4, row[0]);
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers ArrayHandlerTest.java
dgraham 2003/10/22 18:16:53 Modified:dbutils/src/test/org/apache/commons/dbutils/handlers ArrayHandlerTest.java Log: Fixed copyright year. Revision ChangesPath 1.2 +4 -4 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers/ArrayHandlerTest.java Index: ArrayHandlerTest.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers/ArrayHandlerTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ArrayHandlerTest.java 23 Oct 2003 01:15:34 - 1.1 +++ ArrayHandlerTest.java 23 Oct 2003 01:16:52 - 1.2 @@ -7,7 +7,7 @@ * * The Apache Software License, Version 1.1 * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights + * Copyright (c) 2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils TestBean.java
dgraham 2003/10/22 18:18:55 Modified:dbutils/src/test/org/apache/commons/dbutils TestBean.java Log: Made class public so other tests can use it. Revision ChangesPath 1.2 +3 -3 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/TestBean.java Index: TestBean.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/TestBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestBean.java 22 Oct 2003 04:16:04 - 1.1 +++ TestBean.java 23 Oct 2003 01:18:55 - 1.2 @@ -66,7 +66,7 @@ * * @author David Graham */ -class TestBean { +public class TestBean { private String one = null; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers BeanHandlerTest.java BeanListHandlerTest.java
dgraham 2003/10/22 18:26:22 Modified:dbutils/src/test/org/apache/commons/dbutils BaseTestCase.java Added: dbutils/src/test/org/apache/commons/dbutils/handlers BeanHandlerTest.java BeanListHandlerTest.java Log: Added tests for Bean handlers. Revision ChangesPath 1.2 +7 -3 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/BaseTestCase.java Index: BaseTestCase.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/BaseTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- BaseTestCase.java 23 Oct 2003 01:15:34 - 1.1 +++ BaseTestCase.java 23 Oct 2003 01:26:22 - 1.2 @@ -70,6 +70,8 @@ import org.apache.commons.dbutils.handlers.ArrayHandlerTest; import org.apache.commons.dbutils.handlers.ArrayListHandlerTest; +import org.apache.commons.dbutils.handlers.BeanHandlerTest; +import org.apache.commons.dbutils.handlers.BeanListHandlerTest; /** * BaseTestCase is the base class for all test cases as well as the all tests @@ -132,6 +134,8 @@ // test handler implementations suite.addTestSuite(ArrayHandlerTest.class); suite.addTestSuite(ArrayListHandlerTest.class); +suite.addTestSuite(BeanHandlerTest.class); +suite.addTestSuite(BeanListHandlerTest.class); return suite; } 1.1 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers/BeanHandlerTest.java Index: BeanHandlerTest.java === /* * $Header: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers/BeanHandlerTest.java,v 1.1 2003/10/23 01:26:22 dgraham Exp $ * $Revision: 1.1 $ * $Date: 2003/10/23 01:26:22 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowledgement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowledgement may appear in the software itself, *if and wherever such third-party acknowledgements normally appear. * * 4. The names The Jakarta Project, Commons, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * */ package org.apache.commons.dbutils.handlers; import java.sql.SQLException; import org.apache.commons.dbutils.BaseTestCase; import org.apache.commons.dbutils.ResultSetHandler;
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers MapHandlerTest.java MapListHandlerTest.java
dgraham 2003/10/22 18:57:54 Modified:dbutils/src/test/org/apache/commons/dbutils BaseTestCase.java Added: dbutils/src/test/org/apache/commons/dbutils/handlers MapHandlerTest.java MapListHandlerTest.java Log: Added tests for Map handlers. Revision ChangesPath 1.3 +8 -4 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/BaseTestCase.java Index: BaseTestCase.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/BaseTestCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BaseTestCase.java 23 Oct 2003 01:26:22 - 1.2 +++ BaseTestCase.java 23 Oct 2003 01:57:54 - 1.3 @@ -72,6 +72,8 @@ import org.apache.commons.dbutils.handlers.ArrayListHandlerTest; import org.apache.commons.dbutils.handlers.BeanHandlerTest; import org.apache.commons.dbutils.handlers.BeanListHandlerTest; +import org.apache.commons.dbutils.handlers.MapHandlerTest; +import org.apache.commons.dbutils.handlers.MapListHandlerTest; /** * BaseTestCase is the base class for all test cases as well as the all tests @@ -136,7 +138,9 @@ suite.addTestSuite(ArrayListHandlerTest.class); suite.addTestSuite(BeanHandlerTest.class); suite.addTestSuite(BeanListHandlerTest.class); - +suite.addTestSuite(MapHandlerTest.class); +suite.addTestSuite(MapListHandlerTest.class); + return suite; } 1.1 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers/MapHandlerTest.java Index: MapHandlerTest.java === /* * $Header: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers/MapHandlerTest.java,v 1.1 2003/10/23 01:57:54 dgraham Exp $ * $Revision: 1.1 $ * $Date: 2003/10/23 01:57:54 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowledgement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowledgement may appear in the software itself, *if and wherever such third-party acknowledgements normally appear. * * 4. The names The Jakarta Project, Commons, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * */ package org.apache.commons.dbutils.handlers; import java.sql.SQLException; import java.util.Map;
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils MockResultSet.java
dgraham 2003/10/22 19:23:53 Modified:dbutils/src/test/org/apache/commons/dbutils MockResultSet.java Log: Added implementation of getObject(String). Revision ChangesPath 1.4 +48 -16 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/MockResultSet.java Index: MockResultSet.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/MockResultSet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- MockResultSet.java23 Oct 2003 01:13:33 - 1.3 +++ MockResultSet.java23 Oct 2003 02:23:53 - 1.4 @@ -65,6 +65,7 @@ import java.lang.reflect.Method; import java.sql.ResultSet; import java.sql.ResultSetMetaData; +import java.sql.SQLException; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; @@ -102,11 +103,11 @@ new MockResultSet(metaData, rows)); } -/** - * MockResultSet constructor. - * @param metaData - * @param rows A null value indicates an empty codeResultSet/code. - */ + /** + * MockResultSet constructor. + * @param metaData + * @param rows A null value indicates an empty codeResultSet/code. + */ public MockResultSet(ResultSetMetaData metaData, Object[][] rows) { super(); this.metaData = metaData; @@ -132,8 +133,14 @@ } else if (methodName.equals(close)) { } else if (methodName.equals(getObject)) { - int col = ((Integer) args[0]).intValue() - 1; - return this.getObject(col); + + if (args[0] instanceof Integer) { + int col = ((Integer) args[0]).intValue(); + return this.getObject(col); + + } else if (args[0] instanceof String) { + return this.getObject((String) args[0]); + } } else if (methodName.equals(wasNull)) { return this.wasNull(); @@ -145,12 +152,17 @@ return null; } - protected Boolean isLast() { + protected Boolean isLast() throws SQLException { return this.iter.hasNext() ? Boolean.FALSE : Boolean.TRUE; } - protected Object getObject(int columnIndex) { - Object obj = this.currentRow[columnIndex]; +/** + * Gets the object at the given column index. + * @param columnIndex A 1 based index. + * @throws SQLException + */ + protected Object getObject(int columnIndex) throws SQLException { + Object obj = this.currentRow[columnIndex - 1]; if (obj == null) { this.wasNull = (obj == null) ? Boolean.TRUE : Boolean.FALSE; } @@ -158,7 +170,27 @@ return obj; } - protected Boolean next() { + protected Object getObject(String columnName) throws SQLException { + return this.getObject(this.findColumnIndex(columnName)); + } + + /** + * Returns the column index for the given column name. + * @return A 1 based index + * @throws SQLException if the column name is invalid + */ + private int findColumnIndex(String columnName) throws SQLException { + for (int i = 0; i this.currentRow.length; i++) { + int c = i + 1; + if (this.metaData.getColumnName(c).equalsIgnoreCase(columnName)) { + return c; + } + } + + throw new SQLException(columnName + is not a valid column name.); + } + + protected Boolean next() throws SQLException { if (!this.iter.hasNext()) { return Boolean.FALSE; } else { @@ -167,11 +199,11 @@ } } - protected ResultSetMetaData getMetaData() { + protected ResultSetMetaData getMetaData() throws SQLException { return this.metaData; } - protected Boolean wasNull() { + protected Boolean wasNull() throws SQLException { return this.wasNull; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers ScalarHandlerTest.java
dgraham 2003/10/22 19:25:09 Modified:dbutils/src/test/org/apache/commons/dbutils BaseTestCase.java Added: dbutils/src/test/org/apache/commons/dbutils/handlers ScalarHandlerTest.java Log: Added ScalarHandlerTest. Revision ChangesPath 1.4 +5 -3 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/BaseTestCase.java Index: BaseTestCase.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/BaseTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- BaseTestCase.java 23 Oct 2003 01:57:54 - 1.3 +++ BaseTestCase.java 23 Oct 2003 02:25:09 - 1.4 @@ -74,6 +74,7 @@ import org.apache.commons.dbutils.handlers.BeanListHandlerTest; import org.apache.commons.dbutils.handlers.MapHandlerTest; import org.apache.commons.dbutils.handlers.MapListHandlerTest; +import org.apache.commons.dbutils.handlers.ScalarHandlerTest; /** * BaseTestCase is the base class for all test cases as well as the all tests @@ -140,6 +141,7 @@ suite.addTestSuite(BeanListHandlerTest.class); suite.addTestSuite(MapHandlerTest.class); suite.addTestSuite(MapListHandlerTest.class); +suite.addTestSuite(ScalarHandlerTest.class); return suite; } 1.1 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers/ScalarHandlerTest.java Index: ScalarHandlerTest.java === /* * $Header: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/handlers/ScalarHandlerTest.java,v 1.1 2003/10/23 02:25:09 dgraham Exp $ * $Revision: 1.1 $ * $Date: 2003/10/23 02:25:09 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowledgement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowledgement may appear in the software itself, *if and wherever such third-party acknowledgements normally appear. * * 4. The names The Jakarta Project, Commons, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * */ package org.apache.commons.dbutils.handlers; import java.sql.SQLException; import org.apache.commons.dbutils.BaseTestCase; import org.apache.commons.dbutils.ResultSetHandler; /** * ScalarHandlerTest * * @author David Graham */
Re: [math] Complex implementation
I think the hesitancy was simply out of manpower and in interest of getting out a release soon. I'm somewhat surprised that Phil's Complex implementation didn't get added if he had already written it (which I had missed in the thread). Phil, Are you willing to donate your Complex number implementation to the Math library? -Mark Henri Yandell wrote: As an answer to the thread mentioned, it suggests that two implementations of the Complex number functionality are available: 1) VNI's. 2) Colt's. This is no longer true, and the reason for me starting this thread. VNI no longer have their implementation online and the url provided in the email thread no longer takes you to the javadoc. This is made worse by the fact that Colt's implementation is in fact nothing but the VNI implementation. There is 1 implementation from 2 sources, the original of which just shut up shop. I agree with Roger Endo on Complex number usage. We're using it in FFT's amongst other places. So I'm left with Colt. This has legal problems. While VNI's licence is unspecified, Colt includes GPL licenced works. So this rules it out for some uses. In fact, as people here at work are starting to suggest applets rather than flash interfaces, I could be facing a situation in which I cannot download a fresh Complex number implementation which I can legally use. I see no reason not to go with Phil's classes, unless it's to ask VNI if they'd like to submit their popular Complex class. Hen On Wed, 22 Oct 2003, Mark R. Diggory wrote: I'm going to start a list of references to these threads in the xdoc, so we can always get back to it from the home page. When people have questions about the decisions and issues about complex, we'll be able to point them at the history of discussion on the topic. -Mark Brent Worden wrote: Here's the previous complex thread is was referring to http://nagoya.apache.org/eyebrowse/ReadMsg?listId=15msgNo=28132 Brent Worden http://www.brent.worden.org -Original Message- From: Brent Worden [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 21, 2003 10:53 PM To: Jakarta Commons Developers List Subject: RE: [math] Complex implementation I know we've talked about this before, It's not fresh in my mind why we decided against it. -Mark Looking back at the mail archives, it appears we decided against a complex class mainly for two reasons: 1) Not too many RW applications warrant a complex class and can be accommodated with two double values. 2) There are plenty of other OS, complex implementations available so it wasn't crucial to having one in commons-math. Brent Worden http://www.brent.worden.org -- Mark Diggory Software Developer Harvard MIT Data Center http://www.hmdc.harvard.edu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils STATUS.html
dgraham 2003/10/22 19:59:05 Modified:dbutils STATUS.html Log: Removed most of the information from the STATUS file because we're using Maven for project management. Now this file is just a list of current committers on the project. Revision ChangesPath 1.18 +7 -94 jakarta-commons-sandbox/dbutils/STATUS.html Index: STATUS.html === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/STATUS.html,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- STATUS.html 15 Oct 2003 02:25:35 - 1.17 +++ STATUS.html 23 Oct 2003 02:59:05 - 1.18 @@ -2,17 +2,14 @@ head titleStatus File for Jakarta Commons DBUtils Component/title /head -body bgcolor=white +body div align=center h1The Jakarta Commons emDBUtils/em Component/h1 $Id$br / a href=#Introduction[Introduction]/a -a href=#Dependencies[Dependencies]/a -a href=#Release Info[Release Info]/a a href=#Committers[Committers]/a -a href=#Action Items[Action Items]/a br /br / /div @@ -20,50 +17,13 @@ a name=Introduction/a h31. INTRODUCTION/h3 -pThe emDBUtils/em Component contains a set of Java classes that assist with database related code. -The following classes are included:/p -ul -listrongDbUtils/strong - Class to contain simple functions for java.sql code. /li -listrongSimple driver wrapper/strong - An implementation of a driver which wraps a real driver. It contains absolutely no functionality but can be extended to create special jdbc driver wrappers. /li -listrongEnhanced driver wrapper/strong - An extension of the simple driver wrapper which automatically promotes primitives to Object wrappers via the getXxxObject and setXxxObject methods./li -listrongResultSetIterator/strong - View a result set as an iterator. There are two of these at the moment. /li -listrongProcedureUtils/strong - Declaratyve SQL in JAVA code, used to execute and document SQL statements. /li - -/ul - - -a name=Dependencies/a -h32. DEPENDENCIES/h3 - -pThe emDBUtils/em component is dependent upon the following external -components for development and use:/p -ul -lia href=http://java.sun.com/j2se;Java Development Kit/a -(Version 1.2 or later)/li -lia href=http://www.junit.org;JUnit Testing Framework/a -(Version 3.7 or later) - for unit tests only, not required -for deployment/li -lia href=http://qdox.sourceforge.net;QDox JAVA source code parser/a -(Version 1.2 or later) - for metadata in ProcedureUtils/li -licommons-beanutils -in ProcedureUtils/li - - - -/ul - - -a name=Release Info/a -h33. RELEASE INFO/h3 - -pCurrent Release: DBUtils is yet to be released. We hope it will be RSN./p - -pPlanned Next Release: Real Soon Now :) See the -a href=#Action ItemsAction Items/a list for tasks that need to be -completed prior to this release./p +p +The emDBUtils/em Component contains a set of Java classes that assist +with database related code. The following classes are included: +/p a name=Committers/a -h34. COMMITTERS/h3 +h32. COMMITTERS/h3 pThe following individuals are the primary developers and maintainers of this component. Developers who plan to use emDBUtils/em in their own @@ -77,53 +37,6 @@ liFancy volunteering? We need you!/li /ul - -a name=Action Items/a -h35. ACTION ITEMS/h3 - -pThe following action items need to be completed prior to a Version 1.3 -release of this component:/p - -ul -listrongTo code/strongul -liSequence number - A standard sequence number handler. /li -liDbCollection - View a db via a collection/map interface. /li -liNullDriver - A driver which follows the null pattern. /li -liTestDriver - A driver which can be built up with data and then used in unit tests. /li -liMetaDataUtils - Class which provides handy functions for performing metadata. Possibly splits into a ResultSetMetaDataUtils and DatabaseMetaDataUtils. Examples: getPrimaryKeys(Connection, String dotted-tablename);String[] and a getColumnName/Type./li -liDBPoller - A component which can poll a table until a timestamp in a column changes and then can send a notification with the primary key out./li -liA PrimaryKey object for holding pkey information./li -liDbUtils.executeQuery. Overload for int[] to hold null information from java.sql.Types/li -liA Handler interface framework - Wraps statements. Basically an enhanced version of the executeQuery method. Juozas' to supply an implementation/li -liTests for ProcedureUtils/li -liMore Handler implementations and predefined set for ProcedureUtils/li -liIntegration with BeanUtils, converters for database types/li -liDynamic wrappers for JDBC interfaces/li - -/ul/li -listrongIssues/strongul -liDbUtils.executeQuery.
cvs commit: jakarta-commons/net/xdocs changes.xml download.xml migration.xml
brekke 2003/10/22 20:28:16 Modified:net/xdocs changes.xml download.xml migration.xml Log: Reflect released version. Revision ChangesPath 1.15 +1 -4 jakarta-commons/net/xdocs/changes.xml Index: changes.xml === RCS file: /home/cvs/jakarta-commons/net/xdocs/changes.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- changes.xml 6 Oct 2003 03:31:56 - 1.14 +++ changes.xml 23 Oct 2003 03:28:16 - 1.15 @@ -6,10 +6,7 @@ /properties body -release version=1.1.0 date=In CVS - action dev=brekke type=add -Cut a release canidate 1 for v1.1.0! - /action +release version=1.1.0 date=October 23, 2003 action dev=dfs type=add Rory Winston lt;[EMAIL PROTECTED]gt; provided patches to add the following extended NNTP commands to 1.6 +0 -4 jakarta-commons/net/xdocs/download.xml Index: download.xml === RCS file: /home/cvs/jakarta-commons/net/xdocs/download.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- download.xml 6 Oct 2003 03:31:56 - 1.5 +++ download.xml 23 Oct 2003 03:28:16 - 1.6 @@ -11,10 +11,6 @@ section name=Release Builds p -You can download release candidate 1 for v1.1.0 from a href=http://jakarta.apache.org/~brekke/commons-net-1.1.0-rc1.jar;here/a. -/p - -p You can download a href=http://jakarta.apache.org/site/binindex.cgi;binary/a or a href=http://jakarta.apache.org/site/sourceindex.cgi;source/a production releases. /p 1.2 +1 -1 jakarta-commons/net/xdocs/migration.xml Index: migration.xml === RCS file: /home/cvs/jakarta-commons/net/xdocs/migration.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- migration.xml 26 Jan 2003 05:26:13 - 1.1 +++ migration.xml 23 Oct 2003 03:28:16 - 1.2 @@ -15,7 +15,7 @@ /p /section -section name=NetComponents 1.3.8 to Commons/Net 1.0.0 +section name=NetComponents 1.3.8 to Commons/Net p This version is a drop in replacement for NetComponents. Only package names have changed. /p - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils LICENSE
dgraham 2003/10/22 20:31:53 Added: dbutils LICENSE Log: Added a LICENSE file. Revision ChangesPath 1.1 jakarta-commons-sandbox/dbutils/LICENSE Index: LICENSE === /* * * * The Apache Software License, Version 1.1 * * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowledgement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowledgement may appear in the software itself, *if and wherever such third-party acknowledgements normally appear. * * 4. The names The Jakarta Project, Commons, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * */ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils LICENSE
dgraham 2003/10/22 20:32:28 Modified:dbutils LICENSE Log: Changed to ASCII mode. Revision ChangesPath 1.2 +0 -0 jakarta-commons-sandbox/dbutils/LICENSE Index: LICENSE === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/LICENSE,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/xdocs - New directory
dgraham 2003/10/22 20:40:55 jakarta-commons-sandbox/dbutils/xdocs - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/net/xdocs changes.xml
brekke 2003/10/22 20:41:09 Modified:net project.xml net/xdocs changes.xml Log: Bump the version designation and the changes log for the next site build. Revision ChangesPath 1.34 +1 -1 jakarta-commons/net/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons/net/project.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- project.xml 21 Oct 2003 03:21:41 - 1.33 +++ project.xml 23 Oct 2003 03:41:09 - 1.34 @@ -4,7 +4,7 @@ pomVersion3/pomVersion nameJakarta Commons/Net/name idcommons-net/id - currentVersion1.1.0/currentVersion + currentVersion1.1.0-dev/currentVersion organization nameApache Software Foundation/name urlhttp://jakarta.apache.org//url 1.16 +2 -0 jakarta-commons/net/xdocs/changes.xml Index: changes.xml === RCS file: /home/cvs/jakarta-commons/net/xdocs/changes.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- changes.xml 23 Oct 2003 03:28:16 - 1.15 +++ changes.xml 23 Oct 2003 03:41:09 - 1.16 @@ -6,6 +6,8 @@ /properties body +release version=1.1.0-dev date=In CVS +/release release version=1.1.0 date=October 23, 2003 action dev=dfs type=add Rory Winston lt;[EMAIL PROTECTED]gt; provided - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/xdocs navigation.xml todo.xml index.xml
dgraham 2003/10/22 20:41:14 Added: dbutils/xdocs navigation.xml todo.xml index.xml Log: Added xdocs. Revision ChangesPath 1.1 jakarta-commons-sandbox/dbutils/xdocs/navigation.xml Index: navigation.xml === ?xml version=1.0 encoding=ISO-8859-1? project name=DbUtils titleDbUtils/title organizationLogo href=/images/jakarta-logo-blue.gifJakarta/organizationLogo body menu name=DbUtils item name=Overview href=/index.html/ item name=To Do List href=/todo.html/ /menu /body /project 1.1 jakarta-commons-sandbox/dbutils/xdocs/todo.xml Index: todo.xml === ?xml version=1.0? document properties titleTODO/title author email=[EMAIL PROTECTED]David Graham/author /properties body section name=TODO p The following is a list of items that need to be completed in DbUtils. Contributions are welcome!. /p table border=1 tr thAction Item/th thVolunteer/th /tr tr td strongDocumentation/strong - Provide more examples and site info. /td td align=center/td /tr tr td Dynamic wrappers for JDBC interfaces. /td td align=center/td /tr tr td More test cases. /td td align=center/td /tr /table /section /body /document 1.1 jakarta-commons-sandbox/dbutils/xdocs/index.xml Index: index.xml === ?xml version=1.0? document properties titleJDBC Utility Component/title author email=[EMAIL PROTECTED]David Graham/author /properties body section name=DbUtils: JDBC Utility Component section name=Purpose p DbUtils is a small set of classes designed to make working with a href=http://java.sun.com/products/jdbc/;JDBC/a easier. JDBC resource cleanup code is mundane, error prone work so these classes abstract out all of the cleanup tasks from your code leaving you with what you really wanted to do with JDBC in the first place: query and update data. /p pSome of the advantages of using DbUtils are:/p ul li No possibility for resource leaks. Correct JDBC coding isn't difficult but it is time-consuming and tedious. This often leads to connection leaks that maybe difficult to track down. /li li Cleaner, clearer persistence code. The amount of code needed to persist data in a database is drastically reduced. The remaining code clearly expresses your intention without being cluttered with resource cleanup. /li /ul /section section name=Scope of the Package p DbUtils is designed to be: /p ul li strongSmall/strong - you should be able to understand the whole package in a short amount of time. /li li strongTransparent/strong - DbUtils doesn't do any magic behind the scenes. You give it a query, it executes it and cleans up for you. /li li strongFast/strong - You don't need to create a million temporary objects to work with DbUtils. /li /ul p DbUtils is strongnot/strong: /p ul li An Object/Relational bridge - there are plenty of good O/R tools already. DbUtils is for developers looking to use JDBC without all the mundane pieces. /li li A Data Access Object (DAO) framework - DbUtils can be used to build a DAO framework though. /li li An object oriented abstraction of general database objects like a Table, Column, or PrimaryKey. /li li A heavyweight framework of any kind - the goal here is to be a straightforward and easy to use JDBC helper library. /li /ul /section section name=Example Usage p The core classes in DbUtils are codea href=apidocs/org/apache/commons/dbutils/QueryRunner.htmlQueryRunner/a/code and codea href=apidocs/org/apache/commons/dbutils/ResultSetHandler.htmlResultSetHandler/a/code The following example demonstrates how these classes are used together. /p pre DataSource ds = // somehow get DataSource; // 1. Configure QueryRunner with the DataSource // Note that QueryRunner has methods that take a // java.sql.Connection so you are not required to // use DataSources. QueryRunner run = new QueryRunner(ds); // 2. Implement the ResultSetHandler interface or use // one of the provided implementations. This one converts a // ResultSet row
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils ProxyFactoryTest.java
dgraham 2003/10/22 20:53:31 Modified:dbutils/src/java/org/apache/commons/dbutils ProxyFactory.java dbutils/src/test/org/apache/commons/dbutils ProxyFactoryTest.java Log: Added createCallableStatement() and tests. Revision ChangesPath 1.3 +140 -118 jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/ProxyFactory.java Index: ProxyFactory.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/ProxyFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ProxyFactory.java 22 Oct 2003 04:13:21 - 1.2 +++ ProxyFactory.java 23 Oct 2003 03:53:31 - 1.3 @@ -63,6 +63,7 @@ import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy; +import java.sql.CallableStatement; import java.sql.Connection; import java.sql.Driver; import java.sql.PreparedStatement; @@ -81,120 +82,141 @@ */ public class ProxyFactory { -/** - * Class[] for Connection interface. - */ -private static final Class[] connectionClass = new Class[] { Connection.class }; - -/** - * Class[] for Driver interface. - */ -private static final Class[] driverClass = new Class[] { Driver.class }; - -/** - * The Singleton instance of this class. - */ -private static final ProxyFactory instance = new ProxyFactory(); - -/** - * Class[] for ResultSetMetaData interface. - */ -private static final Class[] metaClass = new Class[] { ResultSetMetaData.class }; - -/** - * Class[] for PreparedStatement interface. - */ -private static final Class[] preparedStatementClass = -new Class[] { PreparedStatement.class }; - -/** - * Class[] for ResultSet interface. - */ -private static final Class[] resultSetClass = new Class[] { ResultSet.class }; - -/** - * Class[] for Statement interface. - */ -private static final Class[] statementClass = new Class[] { Statement.class }; - -/** - * Returns the Singleton instance of this class. - */ -public static ProxyFactory instance() { -return instance; -} - -/** - * Protected constructor for ProxyFactory subclasses to use. - */ -protected ProxyFactory() { -super(); -} - -/** - * Creates a new proxy codeConnection/code object. - * @param handler The handler that intercepts/overrides method calls. - */ -public Connection createConnection(InvocationHandler handler) { -return (Connection) Proxy.newProxyInstance( -handler.getClass().getClassLoader(), -connectionClass, -handler); -} - -/** - * Creates a new proxy codeDriver/code object. - * @param handler The handler that intercepts/overrides method calls. - */ -public Driver createDriver(InvocationHandler handler) { -return (Driver) Proxy.newProxyInstance( -handler.getClass().getClassLoader(), -driverClass, -handler); -} - -/** - * Creates a new proxy codePreparedStatement/code object. - * @param handler The handler that intercepts/overrides method calls. - */ -public PreparedStatement createPreparedStatement(InvocationHandler handler) { -return (PreparedStatement) Proxy.newProxyInstance( -handler.getClass().getClassLoader(), -preparedStatementClass, -handler); -} - -/** - * Creates a new proxy codeResultSet/code object. - * @param handler The handler that intercepts/overrides method calls. - */ -public ResultSet createResultSet(InvocationHandler handler) { -return (ResultSet) Proxy.newProxyInstance( -handler.getClass().getClassLoader(), -resultSetClass, -handler); -} - -/** - * Creates a new proxy codeResultSetMetaData/code object. - * @param handler The handler that intercepts/overrides method calls. - */ -public ResultSetMetaData createResultSetMetaData(InvocationHandler handler) { -return (ResultSetMetaData) Proxy.newProxyInstance( -handler.getClass().getClassLoader(), -metaClass, -handler); -} - -/** - * Creates a new proxy codeStatement/code object. - * @param handler The handler that intercepts/overrides method calls. - */ -public Statement createStatement(InvocationHandler handler) { -return (Statement) Proxy.newProxyInstance( -handler.getClass().getClassLoader(), -
cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang SystemUtils.java
ggregory2003/10/22 20:55:35 Modified:lang/src/java/org/apache/commons/lang SystemUtils.java Log: Added JAVA_ENDORSED_DIRS. Revision ChangesPath 1.25 +13 -1 jakarta-commons/lang/src/java/org/apache/commons/lang/SystemUtils.java Index: SystemUtils.java === RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/SystemUtils.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- SystemUtils.java 7 Oct 2003 20:59:46 - 1.24 +++ SystemUtils.java 23 Oct 2003 03:55:34 - 1.25 @@ -133,6 +133,17 @@ public static final String JAVA_COMPILER = getSystemProperty(java.compiler); /** + * pThe codejava.endorsed.dirs/code System Property. Path of endorsed directory + * or directories./p + * + * pDefaults to codenull/code if the runtime does not have + * security access to read this property or the property does not exist./p + * + * @since Java 1.4 + */ +public static final String JAVA_ENDORSED_DIRS = getSystemProperty(java.endorsed.dirs); + +/** * pThe codejava.ext.dirs/code System Property. Path of extension directory * or directories./p * @@ -725,6 +736,7 @@ * instance to operate./p */ public SystemUtils() { +// no init. } //--- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/net/xdocs changes.xml
brekke 2003/10/22 20:58:27 Modified:net project.xml net/xdocs changes.xml Log: Didn't move the version number far enough. Revision ChangesPath 1.35 +1 -1 jakarta-commons/net/project.xml Index: project.xml === RCS file: /home/cvs/jakarta-commons/net/project.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- project.xml 23 Oct 2003 03:41:09 - 1.34 +++ project.xml 23 Oct 2003 03:58:27 - 1.35 @@ -4,7 +4,7 @@ pomVersion3/pomVersion nameJakarta Commons/Net/name idcommons-net/id - currentVersion1.1.0-dev/currentVersion + currentVersion1.2.0-dev/currentVersion organization nameApache Software Foundation/name urlhttp://jakarta.apache.org//url 1.17 +1 -1 jakarta-commons/net/xdocs/changes.xml Index: changes.xml === RCS file: /home/cvs/jakarta-commons/net/xdocs/changes.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- changes.xml 23 Oct 2003 03:41:09 - 1.16 +++ changes.xml 23 Oct 2003 03:58:27 - 1.17 @@ -6,7 +6,7 @@ /properties body -release version=1.1.0-dev date=In CVS +release version=1.2.0-dev date=In CVS /release release version=1.1.0 date=October 23, 2003 action dev=dfs type=add - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/mockdriver MockPreparedStatementTestCase.java MockResultSetTestCase.java MockConnectionTestCase.java MockStatementTestCase.java MockDriverTestCase.java
dgraham 2003/10/22 21:44:39 Removed: dbutils/src/java/org/apache/commons/dbutils/mockdriver MockPreparedStatement.java MockConnection.java MockResultSet.java MockStatement.java MockDriver.java dbutils/src/java/org/apache/commons/dbutils/driver PreparedStatementWrapper.java ConnectionWrapper.java StatementWrapper.java ResultSetWrapper.java CallableStatementWrapper.java DriverWrapper.java dbutils/src/test/org/apache/commons/dbutils/mockdriver MockPreparedStatementTestCase.java MockResultSetTestCase.java MockConnectionTestCase.java MockStatementTestCase.java MockDriverTestCase.java Log: Removed Mock* classes and driver package classes. The driver classes are replaced by ProxyFactory.create* methods. The Mock classes will be replaced with dynamic proxies. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils MockResultSet.java MockResultSetMetaData.java
dgraham 2003/10/22 21:50:05 Modified:dbutils/src/test/org/apache/commons/dbutils MockResultSet.java MockResultSetMetaData.java Log: Made class public so other tests can use it. Revision ChangesPath 1.5 +4 -4 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/MockResultSet.java Index: MockResultSet.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/MockResultSet.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- MockResultSet.java23 Oct 2003 02:23:53 - 1.4 +++ MockResultSet.java23 Oct 2003 04:50:05 - 1.5 @@ -75,7 +75,7 @@ * * @author David Graham */ -class MockResultSet implements InvocationHandler { +public class MockResultSet implements InvocationHandler { private ResultSetMetaData metaData = null; 1.2 +3 -3 jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java Index: MockResultSetMetaData.java === RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockResultSetMetaData.java22 Oct 2003 04:16:04 - 1.1 +++ MockResultSetMetaData.java23 Oct 2003 04:50:05 - 1.2 @@ -71,7 +71,7 @@ * * @author David Graham */ -class MockResultSetMetaData implements InvocationHandler { +public class MockResultSetMetaData implements InvocationHandler { private String[] columnNames = null; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANNOUNCEMENT] Commons/Net v1.1.0 Released
The Jakarta Commons team is pleased to announce the release of version 1.1.0 of the Jakarta Commons/Net component. Commons/Net is an Internet protocol suite Java library which supports Finger, Whois, TFTP, Telnet, POP3, FTP, NNTP, SMTP, and some miscellaneous protocols like Time and Echo as well as BSD R command support. Release notes, documentation, and download links are available on the Commons/Net project site: http://jakarta.apache.org/commons/net/ -- = Jeffrey D. Brekke [EMAIL PROTECTED] Wisconsin, USA [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Outstanding patches?
Mike, Not yet. I am planning to submit the revised new preference architecture patch tonight, so there'll be something to look at. Cheers Oleg -Original Message- From: Michael Becke [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 04:27 To: Commons Project Subject: Outstanding patches? Oleg, Are there any outstanding patches that need review? Mike - 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 23988] - Updates to connectionStaleCheckingEnabled docs.
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=23988. 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=23988 Updates to connectionStaleCheckingEnabled docs. --- Additional Comments From [EMAIL PROTECTED] 2003-10-22 13:09 --- Go for it Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Slow execution of POST method
Hello all. Let me know if this isn't the list to ask this. I'm using httpclient to execute a POST request to our mainframe CICS region. The request takes 3 to 4 seconds to complete through httpclient and less then one second via a web page and browser. When I look at the log files, I see this: 109 2003-10-22 09:31:06,591 [main] DEBUG org.apache.commons.httpclient.methods.EntityEnclosingMethod - enter EntityEnclosingMethod.writeRequestBody(HttpState, HttpConnection) 109 2003-10-22 09:31:06,591 [main] DEBUG org.apache.commons.httpclient.methods.EntityEnclosingMethod - Expecting response 109 2003-10-22 09:31:06,591 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.waitForResponse(int) then there are pages and pages of the following: [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.responseAvaliable() ...then after a couple seconds worth of log entries, I see: 3123 2003-10-22 09:31:09,605 [main] DEBUG org.apache.commons.httpclient.HttpConnection - Waiting for response timeout 3123 2003-10-22 09:31:09,605 [main] DEBUG org.apache.commons.httpclient.HttpMethod - Response not available. Send the request body This is a non-authenticated POST method with one name/value pair. Have I done something incorrectly here? I simply create the PostMethod, add a NameValue pair and execute it. Thanks, Carmine Lucarelli -- This email is confidential. If you are not the intended recipient, please notify the sender by return email and delete this message from your mail box without reading or copying it or any attachments. While Lombard Canada Ltd. runs anti-virus software on all servers and all PCs, it cannot be held responsible for any infected files that you may receive. Lombard Canada Ltd. advises all recipients to virus scan any file attachments. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Slow execution of POST method
Thanks for writing that Oleg! Turns out I was using an alpha version of the 2.0. Upgraded to rc2 and all is now well. Should have thought of it myself! Thanks, Carmine Kalnichevski, Oleg [EMAIL PROTECTED] 10/22/2003 10:02 AM Please respond to Commons HttpClient Project To: Commons HttpClient Project [EMAIL PROTECTED] cc: Fax to: Subject:RE: Slow execution of POST method What version of HttpClient are you using? Oleg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 15:58 To: [EMAIL PROTECTED] Subject: Slow execution of POST method Hello all. Let me know if this isn't the list to ask this. I'm using httpclient to execute a POST request to our mainframe CICS region. The request takes 3 to 4 seconds to complete through httpclient and less then one second via a web page and browser. When I look at the log files, I see this: 109 2003-10-22 09:31:06,591 [main] DEBUG org.apache.commons.httpclient.methods.EntityEnclosingMethod - enter EntityEnclosingMethod.writeRequestBody(HttpState, HttpConnection) 109 2003-10-22 09:31:06,591 [main] DEBUG org.apache.commons.httpclient.methods.EntityEnclosingMethod - Expecting response 109 2003-10-22 09:31:06,591 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.waitForResponse(int) then there are pages and pages of the following: [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.responseAvaliable() ...then after a couple seconds worth of log entries, I see: 3123 2003-10-22 09:31:09,605 [main] DEBUG org.apache.commons.httpclient.HttpConnection - Waiting for response timeout 3123 2003-10-22 09:31:09,605 [main] DEBUG org.apache.commons.httpclient.HttpMethod - Response not available. Send the request body This is a non-authenticated POST method with one name/value pair. Have I done something incorrectly here? I simply create the PostMethod, add a NameValue pair and execute it. Thanks, Carmine Lucarelli -- This email is confidential. If you are not the intended recipient, please notify the sender by return email and delete this message from your mail box without reading or copying it or any attachments. While Lombard Canada Ltd. runs anti-virus software on all servers and all PCs, it cannot be held responsible for any infected files that you may receive. Lombard Canada Ltd. advises all recipients to virus scan any file attachments. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Slow execution of POST method
Carmine, Just for the record, I believe the troublemaker was so called 'expect: 100-continue' handshake. Newer releases of HttpClient do not use the handshake unless explicitly instructed to do so by the user. Apparently the target server (or the proxy server if you use one) has problems with 'expect: 100-continue' stuff. Oleg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 16:13 To: Commons HttpClient Project Subject: RE: Slow execution of POST method Thanks for writing that Oleg! Turns out I was using an alpha version of the 2.0. Upgraded to rc2 and all is now well. Should have thought of it myself! Thanks, Carmine Kalnichevski, Oleg [EMAIL PROTECTED] 10/22/2003 10:02 AM Please respond to Commons HttpClient Project To: Commons HttpClient Project [EMAIL PROTECTED] cc: Fax to: Subject:RE: Slow execution of POST method What version of HttpClient are you using? Oleg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 15:58 To: [EMAIL PROTECTED] Subject: Slow execution of POST method Hello all. Let me know if this isn't the list to ask this. I'm using httpclient to execute a POST request to our mainframe CICS region. The request takes 3 to 4 seconds to complete through httpclient and less then one second via a web page and browser. When I look at the log files, I see this: 109 2003-10-22 09:31:06,591 [main] DEBUG org.apache.commons.httpclient.methods.EntityEnclosingMethod - enter EntityEnclosingMethod.writeRequestBody(HttpState, HttpConnection) 109 2003-10-22 09:31:06,591 [main] DEBUG org.apache.commons.httpclient.methods.EntityEnclosingMethod - Expecting response 109 2003-10-22 09:31:06,591 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.waitForResponse(int) then there are pages and pages of the following: [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.responseAvaliable() ...then after a couple seconds worth of log entries, I see: 3123 2003-10-22 09:31:09,605 [main] DEBUG org.apache.commons.httpclient.HttpConnection - Waiting for response timeout 3123 2003-10-22 09:31:09,605 [main] DEBUG org.apache.commons.httpclient.HttpMethod - Response not available. Send the request body This is a non-authenticated POST method with one name/value pair. Have I done something incorrectly here? I simply create the PostMethod, add a NameValue pair and execute it. Thanks, Carmine Lucarelli -- This email is confidential. If you are not the intended recipient, please notify the sender by return email and delete this message from your mail box without reading or copying it or any attachments. While Lombard Canada Ltd. runs anti-virus software on all servers and all PCs, it cannot be held responsible for any infected files that you may receive. Lombard Canada Ltd. advises all recipients to virus scan any file attachments. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Slow execution of POST method
This is bug #17487 http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17487 resolved on 2003-03-06 by Oleg Odi [EMAIL PROTECTED] wrote: then there are pages and pages of the following: [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.responseAvaliable() - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: addRequestHeader doesn't work for Cookie?
Thanks, Oleg! -Ollie Oleg Kalnichevski wrote: Ollie, That was a conscious design decision. Ideally one should be using HttpState#addCoookie method to add cookies to the HTTP state used by HttpClient. Lately, however, quite a few people complained about inability to add 'Cookie' request headers as a limitation of the existing cookie management API. I am planning to provide a patch against CVS HEAD to address the problem. It's too late to change the 2.0 branch which is already in the final release phase. Regards, Oleg [snipped] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Java 1.1.8 Status
Thanks for the reply, Oleg. Was the prior port mainly an exercise in converting java.util.[CollectionClasses] to com.sun.java.util.[CollectionClasses]? If that's the case (and perhaps with a few new methods sprinkled in) maintaining a patch against the head would probably be the best and easiest way to go. Although I do not quite have the time to keep the JRE 1.1 port completely up to date, I can help keep it relevant, if needed. Thanks, Sam Oleg Kalnichevski wrote: Hi Sam, The fate of the JRE 1.1 port is currently not quite certain. We would love the JRE 1.1 port to remain in the public domain (under Apache or Apache compatible license), provided the it would be supported and kept in sync with our official 2.0 branch. There is a pretty high likelihood of JRE 1.1 compatibility requirement to be dropped next year as far as my project is concerned (the one that pays my bills, I mean). None of HttpClient regulars seems to have any bandwidth left for the JRE 1.1 port either. I passed the JRE 1.1 port onto David Cowan (David.Cowan at apcc.com) who expressed his willingness to help maintain the port. But we still have to decide on the details of how exactly the port is supposed be managed. I suggest that we invite David to join the discussion. There are a few options to consider, ranging from starting a separate SourceSafe project to maintaining a patch against the official 2.0 branch. I am personally fine with any approach as long as our (rather scarce) resources do not end up spread too thin. We already have two branches to maintain (2.0-stable 2.1-development) with 3.0 branch coming some time next year. All I want to see is that new people would step in to maintain the JRE 1.1 port. Cheers Oleg We would love to make the JRE 1.1 available for . On Tue, 2003-10-21 at 22:23, Sam Berlin wrote: Hello everyone, Before inquiring as to the Java 1.1.8 status, let me introduce myself. My name is Sam Berlin, and I'm a developer for LimeWire (www.limewire.org). We are in the process of adding more generic HTTP handling to LimeWire, and have run into one of the many problems with Sun's HttpUrlConnection -- mainly, the fact that it hangs if a socket is closed before any input is read. It is possible to wrap all HttpUrlConnection openings around another class and have some watchdog thread kill them off as they hang, but ideally we wouldn't have to do that. The quandry brought us to looking at other http managers, and ultimately Jakarta's HttpClient. I have succesfully (and very easily!) managed to convert some places in our code to using HttpClient, but we must allow backwards compability with Java 1.1.8, as we have many MacOS 9 (and below) users. (We still receive 10,000+ downloads a week from Mac Classic users.) We would very much like to use HttpClient, as it seems to have a very generic/extensible structure that would fit very well into other places of our code. Searching the archives revealed that Oleg Kalnichevski posted on Sept 23rd that he ported rc1 to be compatable with 1.1.8. Will this process be continuing? Is there a 1.1.8 compatable version (or is one planned) for rc2 and the eventual release? Thank you in advance, and my apologies for immediately asking a question after joining the list. Sam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 24012] New: - Ability to ignore (reject) cookies altogether
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=24012. 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=24012 Ability to ignore (reject) cookies altogether Summary: Ability to ignore (reject) cookies altogether Product: Commons Version: 2.0 Beta 2 Platform: All OS/Version: Other Status: NEW Severity: Enhancement Priority: Other Component: HttpClient AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] I was looking for a way to ignore cookies altogether, but there doesn't appear to be one. I could definitely use this capability right now, and I can see others making use of it at times. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 24012] - Ability to ignore (reject) cookies altogether
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=24012. 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=24012 Ability to ignore (reject) cookies altogether --- Additional Comments From [EMAIL PROTECTED] 2003-10-22 17:23 --- I don't have a strong opinion on the matter, but it sounds like a good candidate for contrib. Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Java 1.1.8 Status
Sam, I thought that reliance on com.sun.* classes was a fairly bad idea. So I opted to replace Java 1.2 collection classes with their Java 1.1 counterparts. That can make maintenance of a patch against HEAD or 2.0 branch difficult. I did not add any new methods or classes but I could not resist the temptation of removing all of the deprecated legacy code in HttpClient. Oleg -Original Message- From: Sam Berlin [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 16:57 To: Commons HttpClient Project Cc: [EMAIL PROTECTED] Subject: Re: Java 1.1.8 Status Thanks for the reply, Oleg. Was the prior port mainly an exercise in converting java.util.[CollectionClasses] to com.sun.java.util.[CollectionClasses]? If that's the case (and perhaps with a few new methods sprinkled in) maintaining a patch against the head would probably be the best and easiest way to go. Although I do not quite have the time to keep the JRE 1.1 port completely up to date, I can help keep it relevant, if needed. Thanks, Sam Oleg Kalnichevski wrote: Hi Sam, The fate of the JRE 1.1 port is currently not quite certain. We would love the JRE 1.1 port to remain in the public domain (under Apache or Apache compatible license), provided the it would be supported and kept in sync with our official 2.0 branch. There is a pretty high likelihood of JRE 1.1 compatibility requirement to be dropped next year as far as my project is concerned (the one that pays my bills, I mean). None of HttpClient regulars seems to have any bandwidth left for the JRE 1.1 port either. I passed the JRE 1.1 port onto David Cowan (David.Cowan at apcc.com) who expressed his willingness to help maintain the port. But we still have to decide on the details of how exactly the port is supposed be managed. I suggest that we invite David to join the discussion. There are a few options to consider, ranging from starting a separate SourceSafe project to maintaining a patch against the official 2.0 branch. I am personally fine with any approach as long as our (rather scarce) resources do not end up spread too thin. We already have two branches to maintain (2.0-stable 2.1-development) with 3.0 branch coming some time next year. All I want to see is that new people would step in to maintain the JRE 1.1 port. Cheers Oleg We would love to make the JRE 1.1 available for . On Tue, 2003-10-21 at 22:23, Sam Berlin wrote: Hello everyone, Before inquiring as to the Java 1.1.8 status, let me introduce myself. My name is Sam Berlin, and I'm a developer for LimeWire (www.limewire.org). We are in the process of adding more generic HTTP handling to LimeWire, and have run into one of the many problems with Sun's HttpUrlConnection -- mainly, the fact that it hangs if a socket is closed before any input is read. It is possible to wrap all HttpUrlConnection openings around another class and have some watchdog thread kill them off as they hang, but ideally we wouldn't have to do that. The quandry brought us to looking at other http managers, and ultimately Jakarta's HttpClient. I have succesfully (and very easily!) managed to convert some places in our code to using HttpClient, but we must allow backwards compability with Java 1.1.8, as we have many MacOS 9 (and below) users. (We still receive 10,000+ downloads a week from Mac Classic users.) We would very much like to use HttpClient, as it seems to have a very generic/extensible structure that would fit very well into other places of our code. Searching the archives revealed that Oleg Kalnichevski posted on Sept 23rd that he ported rc1 to be compatable with 1.1.8. Will this process be continuing? Is there a 1.1.8 compatable version (or is one planned) for rc2 and the eventual release? Thank you in advance, and my apologies for immediately asking a question after joining the list. Sam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Java 1.1.8 Status
Was there any significant overhead in using the 1.1 counterparts? Vector and Hashtable are both synchronized which might be a performance problem if they're used often. I don't know the internals of HttpClient, so I can't say how often they're used. The com.sun classes are no issue for us, as we ship with them anyway... but I agree that a generic Java 1.1 HttpClient should probably not have the reliance. Thanks, Sam Kalnichevski, Oleg wrote: Sam, I thought that reliance on com.sun.* classes was a fairly bad idea. So I opted to replace Java 1.2 collection classes with their Java 1.1 counterparts. That can make maintenance of a patch against HEAD or 2.0 branch difficult. I did not add any new methods or classes but I could not resist the temptation of removing all of the deprecated legacy code in HttpClient. Oleg -Original Message- From: Sam Berlin [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 16:57 To: Commons HttpClient Project Cc: [EMAIL PROTECTED] Subject: Re: Java 1.1.8 Status Thanks for the reply, Oleg. Was the prior port mainly an exercise in converting java.util.[CollectionClasses] to com.sun.java.util.[CollectionClasses]? If that's the case (and perhaps with a few new methods sprinkled in) maintaining a patch against the head would probably be the best and easiest way to go. Although I do not quite have the time to keep the JRE 1.1 port completely up to date, I can help keep it relevant, if needed. Thanks, Sam Oleg Kalnichevski wrote: Hi Sam, The fate of the JRE 1.1 port is currently not quite certain. We would love the JRE 1.1 port to remain in the public domain (under Apache or Apache compatible license), provided the it would be supported and kept in sync with our official 2.0 branch. There is a pretty high likelihood of JRE 1.1 compatibility requirement to be dropped next year as far as my project is concerned (the one that pays my bills, I mean). None of HttpClient regulars seems to have any bandwidth left for the JRE 1.1 port either. I passed the JRE 1.1 port onto David Cowan (David.Cowan at apcc.com) who expressed his willingness to help maintain the port. But we still have to decide on the details of how exactly the port is supposed be managed. I suggest that we invite David to join the discussion. There are a few options to consider, ranging from starting a separate SourceSafe project to maintaining a patch against the official 2.0 branch. I am personally fine with any approach as long as our (rather scarce) resources do not end up spread too thin. We already have two branches to maintain (2.0-stable 2.1-development) with 3.0 branch coming some time next year. All I want to see is that new people would step in to maintain the JRE 1.1 port. Cheers Oleg We would love to make the JRE 1.1 available for . On Tue, 2003-10-21 at 22:23, Sam Berlin wrote: Hello everyone, Before inquiring as to the Java 1.1.8 status, let me introduce myself. My name is Sam Berlin, and I'm a developer for LimeWire (www.limewire.org). We are in the process of adding more generic HTTP handling to LimeWire, and have run into one of the many problems with Sun's HttpUrlConnection -- mainly, the fact that it hangs if a socket is closed before any input is read. It is possible to wrap all HttpUrlConnection openings around another class and have some watchdog thread kill them off as they hang, but ideally we wouldn't have to do that. The quandry brought us to looking at other http managers, and ultimately Jakarta's HttpClient. I have succesfully (and very easily!) managed to convert some places in our code to using HttpClient, but we must allow backwards compability with Java 1.1.8, as we have many MacOS 9 (and below) users. (We still receive 10,000+ downloads a week from Mac Classic users.) We would very much like to use HttpClient, as it seems to have a very generic/extensible structure that would fit very well into other places of our code. Searching the archives revealed that Oleg Kalnichevski posted on Sept 23rd that he ported rc1 to be compatable with 1.1.8. Will this process be continuing? Is there a 1.1.8 compatable version (or is one planned) for rc2 and the eventual release? Thank you in advance, and my apologies for immediately asking a question after joining the list. Sam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,
DO NOT REPLY [Bug 15435] - New Preferences Architecture
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=15435. 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=15435 New Preferences Architecture --- Additional Comments From [EMAIL PROTECTED] 2003-10-22 19:45 --- Follow-up patch 3 committed. I am planning to submit one more, hopefully the final, follow-up patch shortly Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 15435] - New Preferences Architecture
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=15435. 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=15435 New Preferences Architecture --- Additional Comments From [EMAIL PROTECTED] 2003-10-22 20:56 --- Created an attachment (id=8679) Follow-up patch 4 (take 1) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Java 1.1.8 Status
Hi again Oleg, Is the source for the existing 1.1 port available anywhere? I have gone ahead and attempted to port rc2 to Java 1.1 using the com.sun.java.util packages (as that's easiest, and all we really need right now), but a few places use brand new classes/methods. These include NTLM (which uses multiple crypto methods -- the best solution is just to ditch NTLM authentication for Java 1.1), MultiThreadedHttpConnectionManager (using various java.lang.ref classes -- I'm not positive what the best solution here is yet), SSLProtocolSocketFactory (using javax.net.ssl.SSLSocketFactory -- again, the best solution is to just ditch SSL authentication on Java 1.1), and HttpConnection (which uses various get/setSendBufferSize -- perhaps the best solution is to just not perform the optimizations if using Java 1.1). Thanks for your help. The only part of the conversion I'm actually concerned about is the MultiThreadedHttpConnectionManager -- it's easy enough to just ditch the rest of the missing methods/classes. Hopefully the basic spirit behind the MultiThreaded manager can remain. Thanks, Sam Sam Berlin wrote: Was there any significant overhead in using the 1.1 counterparts? Vector and Hashtable are both synchronized which might be a performance problem if they're used often. I don't know the internals of HttpClient, so I can't say how often they're used. The com.sun classes are no issue for us, as we ship with them anyway... but I agree that a generic Java 1.1 HttpClient should probably not have the reliance. Thanks, Sam Kalnichevski, Oleg wrote: Sam, I thought that reliance on com.sun.* classes was a fairly bad idea. So I opted to replace Java 1.2 collection classes with their Java 1.1 counterparts. That can make maintenance of a patch against HEAD or 2.0 branch difficult. I did not add any new methods or classes but I could not resist the temptation of removing all of the deprecated legacy code in HttpClient. Oleg -Original Message- From: Sam Berlin [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 16:57 To: Commons HttpClient Project Cc: [EMAIL PROTECTED] Subject: Re: Java 1.1.8 Status Thanks for the reply, Oleg. Was the prior port mainly an exercise in converting java.util.[CollectionClasses] to com.sun.java.util.[CollectionClasses]? If that's the case (and perhaps with a few new methods sprinkled in) maintaining a patch against the head would probably be the best and easiest way to go. Although I do not quite have the time to keep the JRE 1.1 port completely up to date, I can help keep it relevant, if needed. Thanks, Sam Oleg Kalnichevski wrote: Hi Sam, The fate of the JRE 1.1 port is currently not quite certain. We would love the JRE 1.1 port to remain in the public domain (under Apache or Apache compatible license), provided the it would be supported and kept in sync with our official 2.0 branch. There is a pretty high likelihood of JRE 1.1 compatibility requirement to be dropped next year as far as my project is concerned (the one that pays my bills, I mean). None of HttpClient regulars seems to have any bandwidth left for the JRE 1.1 port either. I passed the JRE 1.1 port onto David Cowan (David.Cowan at apcc.com) who expressed his willingness to help maintain the port. But we still have to decide on the details of how exactly the port is supposed be managed. I suggest that we invite David to join the discussion. There are a few options to consider, ranging from starting a separate SourceSafe project to maintaining a patch against the official 2.0 branch. I am personally fine with any approach as long as our (rather scarce) resources do not end up spread too thin. We already have two branches to maintain (2.0-stable 2.1-development) with 3.0 branch coming some time next year. All I want to see is that new people would step in to maintain the JRE 1.1 port. Cheers Oleg We would love to make the JRE 1.1 available for . On Tue, 2003-10-21 at 22:23, Sam Berlin wrote: Hello everyone, Before inquiring as to the Java 1.1.8 status, let me introduce myself. My name is Sam Berlin, and I'm a developer for LimeWire (www.limewire.org). We are in the process of adding more generic HTTP handling to LimeWire, and have run into one of the many problems with Sun's HttpUrlConnection -- mainly, the fact that it hangs if a socket is closed before any input is read. It is possible to wrap all HttpUrlConnection openings around another class and have some watchdog thread kill them off as they hang, but ideally we wouldn't have to do that. The quandry brought us to looking at other http managers, and ultimately Jakarta's HttpClient. I have succesfully (and very easily!) managed to convert some places in our code to using HttpClient, but we must allow backwards compability with Java 1.1.8, as we have many MacOS 9 (and below) users. (We still receive 10,000+ downloads a week from Mac Classic users.) We would very
Re: Java 1.1.8 Status
The use of references in the MultiThreadedHttpConnectionManager is not entirely necessary. They are only used to reclaim connections that were not released properly. In general circumstances connection reclaiming should not be needed. Mike On Wednesday, October 22, 2003, at 05:26 PM, Sam Berlin wrote: Hi again Oleg, Is the source for the existing 1.1 port available anywhere? I have gone ahead and attempted to port rc2 to Java 1.1 using the com.sun.java.util packages (as that's easiest, and all we really need right now), but a few places use brand new classes/methods. These include NTLM (which uses multiple crypto methods -- the best solution is just to ditch NTLM authentication for Java 1.1), MultiThreadedHttpConnectionManager (using various java.lang.ref classes -- I'm not positive what the best solution here is yet), SSLProtocolSocketFactory (using javax.net.ssl.SSLSocketFactory -- again, the best solution is to just ditch SSL authentication on Java 1.1), and HttpConnection (which uses various get/setSendBufferSize -- perhaps the best solution is to just not perform the optimizations if using Java 1.1). Thanks for your help. The only part of the conversion I'm actually concerned about is the MultiThreadedHttpConnectionManager -- it's easy enough to just ditch the rest of the missing methods/classes. Hopefully the basic spirit behind the MultiThreaded manager can remain. Thanks, Sam Sam Berlin wrote: Was there any significant overhead in using the 1.1 counterparts? Vector and Hashtable are both synchronized which might be a performance problem if they're used often. I don't know the internals of HttpClient, so I can't say how often they're used. The com.sun classes are no issue for us, as we ship with them anyway... but I agree that a generic Java 1.1 HttpClient should probably not have the reliance. Thanks, Sam Kalnichevski, Oleg wrote: Sam, I thought that reliance on com.sun.* classes was a fairly bad idea. So I opted to replace Java 1.2 collection classes with their Java 1.1 counterparts. That can make maintenance of a patch against HEAD or 2.0 branch difficult. I did not add any new methods or classes but I could not resist the temptation of removing all of the deprecated legacy code in HttpClient. Oleg -Original Message- From: Sam Berlin [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 16:57 To: Commons HttpClient Project Cc: [EMAIL PROTECTED] Subject: Re: Java 1.1.8 Status Thanks for the reply, Oleg. Was the prior port mainly an exercise in converting java.util.[CollectionClasses] to com.sun.java.util.[CollectionClasses]? If that's the case (and perhaps with a few new methods sprinkled in) maintaining a patch against the head would probably be the best and easiest way to go. Although I do not quite have the time to keep the JRE 1.1 port completely up to date, I can help keep it relevant, if needed. Thanks, Sam Oleg Kalnichevski wrote: Hi Sam, The fate of the JRE 1.1 port is currently not quite certain. We would love the JRE 1.1 port to remain in the public domain (under Apache or Apache compatible license), provided the it would be supported and kept in sync with our official 2.0 branch. There is a pretty high likelihood of JRE 1.1 compatibility requirement to be dropped next year as far as my project is concerned (the one that pays my bills, I mean). None of HttpClient regulars seems to have any bandwidth left for the JRE 1.1 port either. I passed the JRE 1.1 port onto David Cowan (David.Cowan at apcc.com) who expressed his willingness to help maintain the port. But we still have to decide on the details of how exactly the port is supposed be managed. I suggest that we invite David to join the discussion. There are a few options to consider, ranging from starting a separate SourceSafe project to maintaining a patch against the official 2.0 branch. I am personally fine with any approach as long as our (rather scarce) resources do not end up spread too thin. We already have two branches to maintain (2.0-stable 2.1-development) with 3.0 branch coming some time next year. All I want to see is that new people would step in to maintain the JRE 1.1 port. Cheers Oleg We would love to make the JRE 1.1 available for . On Tue, 2003-10-21 at 22:23, Sam Berlin wrote: Hello everyone, Before inquiring as to the Java 1.1.8 status, let me introduce myself. My name is Sam Berlin, and I'm a developer for LimeWire (www.limewire.org). We are in the process of adding more generic HTTP handling to LimeWire, and have run into one of the many problems with Sun's HttpUrlConnection -- mainly, the fact that it hangs if a socket is closed before any input is read. It is possible to wrap all HttpUrlConnection openings around another class and have some watchdog thread kill them off as they hang, but ideally we wouldn't have to do that. The quandry
NTLM Question
Hi, I am interested in using NTLM for authentication on my Apache based webdav server. I am using the Slide client (based on httpclient) I understand that HttpClient supports NTLM but requires me to supply the user credentials. I want to obtain the user's logon credentials from the OS and avoid requiring the user to reenter his userid and password. Any ideas on how I do that under java. thanks Russell Thamm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]