[jira] Commented: (BEANUTILS-72) [beanutils] Problem with setting properties which are strings array.
[ https://issues.apache.org/jira/browse/BEANUTILS-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497373 ] ivan matmati commented on BEANUTILS-72: --- I will see how you correct this issue with a better Converter implementation.Notice that this code solved my problem and seems very logical.Why give the first element of an array and not the array itself to the Converter ?I will try with your fix and will give you eventually feedback. Thanks. Ivan Matmati. -- Ivan matmati [beanutils] Problem with setting properties which are strings array. - Key: BEANUTILS-72 URL: https://issues.apache.org/jira/browse/BEANUTILS-72 Project: Commons BeanUtils Issue Type: Bug Components: ConvertUtils Converters Environment: Operating System: other Platform: PC Reporter: ivan matmati Fix For: 1.8.0 In my work, I had to deal with indexed properties with Struts.Some of them, using multibox, should be string arrays. But unfortunately, the setter I wrote was never called (It had a string array as input parameter with the index as an other one).As I search the code, I found what seemed a mistake in the code of BeanUtilsBean (version 1.7 of commons bean utilities). In line 1003, in setProperty method : else if (value instanceof String[]) { newValue = getConvertUtils().convert(((String[]) value)[0], type); I had to correct it to else if (value instanceof String[]) { newValue = getConvertUtils().convert(((String[]) value), type); In no way, I want a string as newValue but the array itself. I hope it can help. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [VOTE] Release commons-parent 3
Hi Phil, Phil Steitz wrote on Sunday, May 20, 2007 5:53 PM: On 5/20/07, Jörg Schaible [EMAIL PROTECTED] wrote: [snip] Right. Therefore we need to nail down the plugin versions. And yes, the settings from the pluginManagement in the parent is inherited. Should have been more clear in my question. If you partially configure a plugin in the parent, can you then just add stuff, such as the version, in a child without repeating the things specified in the parent config? If the answer to that is no then there is no value in partially configuring plugins in the parent. Configuration is merged from pluginDependency and plugins defined directly in the build section. Unfortunately it is not merged for plugins in the report section (which prevents setting source version for javadoc plugin in the configurtation of the parent anhd set individual links to external javadocs in the projcets). - Jörg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [beanutils] commons collection classes
This is a major broken window, IMHO, and it should be fixed. Why not leave the API the way it is and just take out the classes that are duplicated? They are in the same packages as are in the commons-collections jar file. I understand that it causes a dependency on commons collections (which is big), but at least the user knows what exactly they're getting rather than playing classloader bingo. Also, the dependency is a conditional one. You only need collections if you're using these specific classes. There are probably not too many users of these classes anyway. I would venture to say that there are probably not too many projects using beanutils that aren't using collections anyway (once you start playing with commons libraries, you can't stop; they're addictive). On 5/19/07, Stephen Colebourne [EMAIL PROTECTED] wrote: Torsten Curdt wrote: On 18.05.2007, at 21:56, Thorbjørn Ravn Andersen wrote: I suggest marking the offending methods as deprecated for the 1.x series, and schedule them for removal in the 2.x series. Well, then let's create a 2.x branch and do a release without the classes *now*. No problem with that. Then it is communicated and people can choose. But doing *nothing* just because of binary compatibility is silly. Doing nothing because of binary incompatibility is not silly, its essential. Commons has to be far more extreme than almost any other OSS project on this point. In fact, I contend that commons is now in such a position that we can't make incompatible changes even in major version number releases. Especially as no one *has* to upgrade libraries. And checking release notes if you do can't hurt if you upgrade. Users are forced to upgrade all the time, and thats why they require backwards compatibility. For example, if project A is complied against the old [beanutils] jar, while project B is compiled against the new [beanutils] jar, then it is impossible to use both project A and project B together. You cannot physically upgrade the jar file to the one B needs, because A needs the old one. The only solutions to this at present are - for the 2.x series to have a different package name, including 'v2' - to force the user to play with class loaders, so they can load two different versions of the same class In summary, I suggest we all just let this one be. This isn't causing major pain IMO. The lesson should be to not have dependencies between commons projects wherever possible. Stephen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r540115 - /jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/ArrayConverter.java
Author: niallp Date: Mon May 21 04:20:15 2007 New Revision: 540115 URL: http://svn.apache.org/viewvc?view=revrev=540115 Log: BEANUTILS-242 - JavaDoc improvements and change convertToString() method to delegate to convertToCollection(0 method for non-arrays Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/ArrayConverter.java Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/ArrayConverter.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/ArrayConverter.java?view=diffrev=540115r1=540114r2=540115 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/ArrayConverter.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/ArrayConverter.java Mon May 21 04:20:15 2007 @@ -48,9 +48,34 @@ * of the delegate [EMAIL PROTECTED] Converter}./li * libDelimited Lists/b - can Convert bto/b and bfrom/b a * delimited list in String format./li - * libMulti Dimensional Arrays/b - its possible to convert to - * multi-dimensional arrays, by embedding [EMAIL PROTECTED] ArrayConverter} + * libConversion to String/b - converts an array to a + * codeString/code in one of two ways: as a idelimited list/i + * or by converting the first element in the array to a String - this + * is controlled by the [EMAIL PROTECTED] ArrayConverter#setOnlyFirstToString(boolean)} + * parameter./li + * libMulti Dimensional Arrays/b - its possible to convert a codeString/code + * to a multi-dimensional arrays, by embedding [EMAIL PROTECTED] ArrayConverter} * within each other - see example below./li + * libDefault Value/b/li + * ul + * libiNo Default/b/i - use the + * [EMAIL PROTECTED] ArrayConverter#ArrayConverter(Class, Converter)} + * constructor to create a converter which throws a + * [EMAIL PROTECTED] ConversionException} if the value is missing or + * invalid./li + * libiDefault values/b/i - use the + * [EMAIL PROTECTED] ArrayConverter#ArrayConverter(Class, Converter, int)} + * constructor to create a converter which returns a idefault + * value/i. The idefaultSize/i parameter controls the + * idefault value/i in the following way:/li + * ul + *liidefaultSize lt; 0/i - default is codenull/code/li + *liidefaultSize = 0/i - default is an array of length zero/li + *liidefaultSize gt; 0/i - default is an array with a + *length specified by codedefaultSize/code (N.B. elements + *in the array will be codenull/code)/li + * /ul + * /ul * /ul * * h3Parsing Delimited Lists/h3 @@ -66,7 +91,7 @@ * /ul * * h3Multi Dimensional Arrays/h3 - * It is possible to convert to mulit-dimensional arrays by using + * It is possible to convert a codeString/code to mulit-dimensional arrays by using * [EMAIL PROTECTED] ArrayConverter} as the element [EMAIL PROTECTED] Converter} * within another [EMAIL PROTECTED] ArrayConverter}. * p @@ -133,7 +158,7 @@ /** * Construct an barray/b codeConverter/code with the specified * bcomponent/b codeConverter/code that returns a default - * array of the specified size if an error occurs. + * array of the specified size (or codenull/code) if an error occurs. * * @param defaultType The default array type this * codeConverter/code handles @@ -185,7 +210,7 @@ } /** - * Convert the input object into a String. + * Handles conversion to a String. * * @param value The value to be converted. * @return the converted String value. @@ -197,13 +222,10 @@ Class type = value.getClass(); if (type.isArray()) { size = Array.getLength(value); -} else if (value instanceof Collection) { -Collection collection = (Collection)value; +} else { +Collection collection = convertToCollection(type, value); size = collection.size(); iterator = collection.iterator(); -} else { -Object converted = elementConverter.convert(String.class, value); -return (converted == null ? (String)getDefault(String.class) : converted.toString()); } if (size == 0) { @@ -232,8 +254,7 @@ } /** - * Convert the input object into an array of the - * specified type. + * Handles conversion to an array of the specified type. * * @param type The type
[jira] Updated: (JXPATH-77) Added selectNodes / selectSingleNode to CompiledExpression
[ https://issues.apache.org/jira/browse/JXPATH-77?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matt Benson updated JXPATH-77: -- Fix Version/s: post-1.3 Added selectNodes / selectSingleNode to CompiledExpression -- Key: JXPATH-77 URL: https://issues.apache.org/jira/browse/JXPATH-77 Project: Commons JXPath Issue Type: Improvement Affects Versions: 1.2 Final Reporter: Simon Raess Priority: Minor Fix For: post-1.3 Attachments: patch2.txt CompiledExpression did not have the methods selectNodes / selectSingleNodes. The attached patch adds those methods. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Resolved: (JXPATH-79) Error when accessing JXPathContext methods in Concurrent Scenario
[ https://issues.apache.org/jira/browse/JXPATH-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matt Benson resolved JXPATH-79. --- Resolution: Duplicate Fix Version/s: 1.3 Error when accessing JXPathContext methods in Concurrent Scenario - Key: JXPATH-79 URL: https://issues.apache.org/jira/browse/JXPATH-79 Project: Commons JXPath Issue Type: Bug Affects Versions: 1.2 Final Reporter: perumalraj Fix For: 1.3 I am getting following error when many parallel threads access JXPathContext methods. (But In case of a single thread, It works fine). Caused by: java.lang.NullPointerException at org.apache.commons.jxpath.JXPathBasicBeanInfo.getPropertyDescriptor(JXPathBasicBeanInfo.java:104) at org.apache.commons.jxpath.ri.model.beans.BeanPropertyPointer.getPropertyDescriptor(BeanPropertyPointer.java:267) at org.apache.commons.jxpath.ri.model.beans.BeanPropertyPointer.isActualProperty(BeanPropertyPointer.java:151) at org.apache.commons.jxpath.ri.model.beans.PropertyPointer.isActual(PropertyPointer.java:80) at org.apache.commons.jxpath.ri.axes.SimplePathInterpreter.doStepNoPredicatesPropertyOwner(SimplePathInterpreter.java:191) at org.apache.commons.jxpath.ri.axes.SimplePathInterpreter.doStep(SimplePathInterpreter.java:142) at org.apache.commons.jxpath.ri.axes.SimplePathInterpreter.doStepNoPredicatesPropertyOwner(SimplePathInterpreter.java:232) at org.apache.commons.jxpath.ri.axes.SimplePathInterpreter.doStep(SimplePathInterpreter.java:142) at org.apache.commons.jxpath.ri.axes.SimplePathInterpreter.doStepNoPredicatesPropertyOwner(SimplePathInterpreter.java:232) at org.apache.commons.jxpath.ri.axes.SimplePathInterpreter.doStep(SimplePathInterpreter.java:142) at org.apache.commons.jxpath.ri.axes.SimplePathInterpreter.interpretSimpleLocationPath(SimplePathInterpreter.java:77) at org.apache.commons.jxpath.ri.compiler.Path.getSingleNodePointerForSteps(Path.java:153) at org.apache.commons.jxpath.ri.compiler.LocationPath.computeValue(LocationPath.java:82) at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:314) at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:280) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[IO] Filename relativiser?
Are there any plans to implement a filename relativiser? i.e., given an absolute directory and absolute filename it would return a relative filename. e.g. (in Unix syntax): /a/b/c and /a/b/c/d/e.txt = d/e.txt and optionally: /a/b/c/f and /a/b/c/d/e.txt = ../d/e.txt It does not look particularly difficult to do, but it does not seem trivial either, so it might be a useful addition to Commons IO... S. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [IO] Filename relativiser?
On 5/21/07, sebb [EMAIL PROTECTED] wrote: Are there any plans to implement a filename relativiser? i.e., given an absolute directory and absolute filename it would return a relative filename. e.g. (in Unix syntax): /a/b/c and /a/b/c/d/e.txt = d/e.txt and optionally: /a/b/c/f and /a/b/c/d/e.txt = ../d/e.txt It does not look particularly difficult to do, but it does not seem trivial either, so it might be a useful addition to Commons IO... +1 sounds like a good candidate for FilenameUtils - commons JCI has a relative method in its ConverstionUtils class http://tinyurl.com/2kj6ul Niall S. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [IO] Filename relativiser?
On 21/05/07, Niall Pemberton [EMAIL PROTECTED] wrote: On 5/21/07, sebb [EMAIL PROTECTED] wrote: Are there any plans to implement a filename relativiser? i.e., given an absolute directory and absolute filename it would return a relative filename. e.g. (in Unix syntax): /a/b/c and /a/b/c/d/e.txt = d/e.txt and optionally: /a/b/c/f and /a/b/c/d/e.txt = ../d/e.txt It does not look particularly difficult to do, but it does not seem trivial either, so it might be a useful addition to Commons IO... +1 sounds like a good candidate for FilenameUtils - commons JCI has a relative method in its ConverstionUtils class s/stion/sion/ http://tinyurl.com/2kj6ul Thanks. That would handle the first case above, but not the optional case. The optional case probably needs a dottiness (!) limit - i.e. how many .. segments are allowed. S. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jira] Updated: (LANG-335) Comparisons of Dates and Calendars to second precision
Alex Marshall (JIRA) skrev den 21-05-2007 02:49: [ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Marshall updated LANG-335: --- Attachment: DateUtilsExtensions.java DateUtilsExtensions.java contains sample implementations for equals and hashCode that were taken straight from the Sun 1.6.0 JDK implementation and modified to provide equals and hashCode functions to second-level precision. Clarify me on this - is it allowed to use GPL code in Apache projects? -- Thorbjørn smime.p7s Description: S/MIME Cryptographic Signature
[jira] Resolved: (LANG-335) Comparisons of Dates and Calendars to second precision
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton resolved LANG-335. -- Resolution: Won't Fix When attaching your code to this ticket you chose the Grant license to ASF for inclusion in ASF works (as per the Apache Software License[1] option. However in order to be able to grant a license to the ASF for the work you need to be either be the copyright/license holder of that work or that work must be licensed in way compatible[2] with the Apache Software License. Sun's license for JDK 1.6.0 does not give you the authority to grant the ASF a license for the work, therefore this cannot be considered. More details on the Apache Software License and 3rd party works are available in the following locations: http://www.apache.org/licenses/LICENSE-2.0 http://people.apache.org/~cliffs/3party.html You need to be very careful about copying other peoples work since if you infringe someone elses intellectual property rights then you are at risk of being sued. Comparisons of Dates and Calendars to second precision -- Key: LANG-335 URL: https://issues.apache.org/jira/browse/LANG-335 Project: Commons Lang Issue Type: New Feature Affects Versions: 2.3 Environment: Windows, JDK 1.6.0, Eclipse 3.2 Reporter: Alex Marshall Priority: Trivial Attachments: DateUtilsExtensions.java The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jira] Updated: (LANG-335) Comparisons of Dates and Calendars to second precision
On 5/21/07, Thorbjørn Ravn Andersen [EMAIL PROTECTED] wrote: Alex Marshall (JIRA) skrev den 21-05-2007 02:49: [ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Marshall updated LANG-335: --- Attachment: DateUtilsExtensions.java DateUtilsExtensions.java contains sample implementations for equals and hashCode that were taken straight from the Sun 1.6.0 JDK implementation and modified to provide equals and hashCode functions to second-level precision. Clarify me on this - is it allowed to use GPL code in Apache projects? No, but this is even worse since JDK 1.6.0 source code is not under the GPL license or any kind of FOSS license. Niall -- Thorbjørn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[vfs] trunk build fails?
I am trying to install VFS into our local maven repository (we require WebDAV support, so we need the sandbox) and I can't get a clean build using Maven2. I checkout, cd to the directory, and run a mvn install and I get... [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] Commons VFS (project) [INFO] core [INFO] examples [INFO] sandbox [INFO] - --- [INFO] Building Commons VFS (project) [INFO]task-segment: [clean, install] [INFO] - --- [INFO] [clean:clean] [INFO] Deleting directory /home/jcarman/commons-vfs/target [INFO] Deleting directory /home/jcarman/commons-vfs/target/classes [INFO] Deleting directory /home/jcarman/commons-vfs/target/test-classes [INFO] [antrun:run {execution: default}] [INFO] Executing tasks [copy] Copying 2 files to /home/jcarman/commons-vfs/target/classes/META-INF [INFO] Executed tasks [INFO] [site:attach-descriptor] [INFO] [install:install] [INFO] Installing /home/jcarman/commons-vfs/pom.xml to /home/jcarman/.m2/reposit ory/org/apache/commons/commons-vfs-project/1.1-SNAPSHOT/commons- vfs-project-1.1- SNAPSHOT.pom [INFO] - --- [INFO] Building core [INFO]task-segment: [clean, install] [INFO] - --- [INFO] [clean:clean] [INFO] Deleting directory /home/jcarman/commons-vfs/core/target [INFO] Deleting directory /home/jcarman/commons-vfs/core/target/classes [INFO] Deleting directory /home/jcarman/commons-vfs/core/target/test-classes [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] Compiling 218 source files to /home/jcarman/commons-vfs/core/target/classes [INFO] [antrun:run {execution: default}] [INFO] Executing tasks [echo] Setup test-data environment [copy] Copying 30 files to /home/jcarman/commons-vfs/core/target/classes/te st-data [INFO] Executed tasks [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] Compiling 58 source files to /home/jcarman/commons-vfs/core/target/test-classes [INFO] [surefire:test] [INFO] Surefire report directory: /home/jcarman/commons-vfs/core/target/surefire -reports --- T E S T S --- Running org.apache.commons.vfs.provider.ram.test.RamProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.109 sec Running org.apache.commons.vfs.provider.http.test.HttpProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.069 sec Running org.apache.commons.vfs.provider.url.test.UrlHttpProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec Running org.apache.commons.vfs.provider.ftp.test.FtpProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec Running org.apache.commons.vfs.provider.tar.test.TgzProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.014 sec Running org.apache.commons.vfs.provider.local.test.LocalProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec Running org.apache.commons.vfs.RunTest Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.081 sec May 21, 2007 1:13:24 PM org.apache.commons.vfs.VfsLog info INFO: Using /tmp/vfs_cache as temporary files store. Running org.apache.commons.vfs.provider.jar.test.JarProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.026 sec Running org.apache.commons.vfs.provider.tar.test.NestedTarTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.116 sec Running org.apache.commons.vfs.test.FileSystemManagerFactoryTestCase Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.305 sec FA ILURE! Running org.apache.commons.vfs.provider.tar.test.Tbz2ProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec Running org.apache.commons.vfs.provider.tar.test.NestedTbz2TestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec Running org.apache.commons.vfs.provider.url.test.UrlProviderHttpTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec Running org.apache.commons.vfs.util.DelegatingFileSystemOptionsBuilderTest May 21, 2007 1:13:24 PM org.apache.commons.vfs.VfsLog info INFO: Using /tmp/vfs_cache as temporary files store. May 21, 2007 1:13:24 PM org.apache.commons.vfs.VfsLog info INFO: Using /tmp/vfs_cache as temporary files store. Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.079 sec Running org.apache.commons.vfs.provider.zip.test.NestedZipTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time
[jira] Updated: (LANG-335) Comparisons of Dates and Calendars to second precision
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated LANG-335: - Attachment: (was: DateUtilsExtensions.java) Comparisons of Dates and Calendars to second precision -- Key: LANG-335 URL: https://issues.apache.org/jira/browse/LANG-335 Project: Commons Lang Issue Type: New Feature Affects Versions: 2.3 Environment: Windows, JDK 1.6.0, Eclipse 3.2 Reporter: Alex Marshall Priority: Trivial The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Commented: (LANG-335) Comparisons of Dates and Calendars to second precision
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497521 ] Niall Pemberton commented on LANG-335: -- I've deleted the attachment Comparisons of Dates and Calendars to second precision -- Key: LANG-335 URL: https://issues.apache.org/jira/browse/LANG-335 Project: Commons Lang Issue Type: New Feature Affects Versions: 2.3 Environment: Windows, JDK 1.6.0, Eclipse 3.2 Reporter: Alex Marshall Priority: Trivial The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jira] Updated: (LANG-335) Comparisons of Dates and Calendars to second precision
On 5/21/07, Niall Pemberton [EMAIL PROTECTED] wrote: On 5/21/07, Thorbjørn Ravn Andersen [EMAIL PROTECTED] wrote: Alex Marshall (JIRA) skrev den 21-05-2007 02:49: [ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alex Marshall updated LANG-335: --- Attachment: DateUtilsExtensions.java DateUtilsExtensions.java contains sample implementations for equals and hashCode that were taken straight from the Sun 1.6.0 JDK implementation and modified to provide equals and hashCode functions to second-level precision. Clarify me on this - is it allowed to use GPL code in Apache projects? No, but this is even worse since JDK 1.6.0 source code is not under the GPL license or any kind of FOSS license. btw thanks for highlighting this - I've closed the ticket and deleted the attachment Niall -- Thorbjørn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Created: (BEANUTILS-280) Check binary compatibility is still good
Check binary compatibility is still good Key: BEANUTILS-280 URL: https://issues.apache.org/jira/browse/BEANUTILS-280 Project: Commons BeanUtils Issue Type: Task Reporter: Henri Yandell Fix For: 1.8.0 Clirr/jardiff/whatever. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [vfs] trunk build fails?
looks like the a test is failing. For now, please add -Dmaven.test.skip=true to your mvn cmd line as our tests do not really work with surefire (maven2) yet. Mario -Original Message- From: James Carman [EMAIL PROTECTED] Date: Monday, Mai 21, 2007 7:15 pm Subject: [vfs] trunk build fails? To: Reply-Jakarta Commons Developers List commons-dev@jakarta.apache.orgTo: Jakarta Commons Developers List commons-dev@jakarta.apache.org I am trying to install VFS into our local maven repository (we require WebDAV support, so we need the sandbox) and I can't get a clean build using Maven2. I checkout, cd to the directory, and run a mvn install and I get... [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] Commons VFS (project) [INFO] core [INFO] examples [INFO] sandbox [INFO] - --- [INFO] Building Commons VFS (project) [INFO]task-segment: [clean, install] [INFO] - --- [INFO] [clean:clean] [INFO] Deleting directory /home/jcarman/commons-vfs/target [INFO] Deleting directory /home/jcarman/commons-vfs/target/classes [INFO] Deleting directory /home/jcarman/commons-vfs/target/test-classes [INFO] [antrun:run {execution: default}] [INFO] Executing tasks [copy] Copying 2 files to /home/jcarman/commons-vfs/target/classes/META-INF [INFO] Executed tasks [INFO] [site:attach-descriptor] [INFO] [install:install] [INFO] Installing /home/jcarman/commons-vfs/pom.xml to /home/jcarman/.m2/reposit ory/org/apache/commons/commons-vfs-project/1.1-SNAPSHOT/commons- vfs-project-1.1- SNAPSHOT.pom [INFO] - --- [INFO] Building core [INFO]task-segment: [clean, install] [INFO] - --- [INFO] [clean:clean] [INFO] Deleting directory /home/jcarman/commons-vfs/core/target [INFO] Deleting directory /home/jcarman/commons-vfs/core/target/classes [INFO] Deleting directory /home/jcarman/commons-vfs/core/target/test-classes [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] Compiling 218 source files to /home/jcarman/commons-vfs/core/target/classes [INFO] [antrun:run {execution: default}] [INFO] Executing tasks [echo] Setup test-data environment [copy] Copying 30 files to /home/jcarman/commons-vfs/core/target/classes/te st-data [INFO] Executed tasks [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] Compiling 58 source files to /home/jcarman/commons-vfs/core/target/test-classes [INFO] [surefire:test] [INFO] Surefire report directory: /home/jcarman/commons-vfs/core/target/surefire -reports --- T E S T S --- Running org.apache.commons.vfs.provider.ram.test.RamProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.109 sec Running org.apache.commons.vfs.provider.http.test.HttpProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.069 sec Running org.apache.commons.vfs.provider.url.test.UrlHttpProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec Running org.apache.commons.vfs.provider.ftp.test.FtpProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec Running org.apache.commons.vfs.provider.tar.test.TgzProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.014 sec Running org.apache.commons.vfs.provider.local.test.LocalProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec Running org.apache.commons.vfs.RunTest Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.081 sec May 21, 2007 1:13:24 PM org.apache.commons.vfs.VfsLog info INFO: Using /tmp/vfs_cache as temporary files store. Running org.apache.commons.vfs.provider.jar.test.JarProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.026 sec Running org.apache.commons.vfs.provider.tar.test.NestedTarTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.116 sec Running org.apache.commons.vfs.test.FileSystemManagerFactoryTestCase Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.305 sec FA ILURE! Running org.apache.commons.vfs.provider.tar.test.Tbz2ProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec Running org.apache.commons.vfs.provider.tar.test.NestedTbz2TestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec Running org.apache.commons.vfs.provider.url.test.UrlProviderHttpTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec Running
Re: [vfs] trunk build fails?
Any ETA on when they'll be fixed? On 5/21/07, Mario Ivankovits [EMAIL PROTECTED] wrote: looks like the a test is failing. For now, please add -Dmaven.test.skip=true to your mvn cmd line as our tests do not really work with surefire (maven2) yet. Mario -Original Message- From: James Carman [EMAIL PROTECTED] Date: Monday, Mai 21, 2007 7:15 pm Subject: [vfs] trunk build fails? To: Reply-Jakarta Commons Developers List commons-dev@jakarta.apache.orgTo: Jakarta Commons Developers List commons-dev@jakarta.apache.org I am trying to install VFS into our local maven repository (we require WebDAV support, so we need the sandbox) and I can't get a clean build using Maven2. I checkout, cd to the directory, and run a mvn install and I get... [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] Commons VFS (project) [INFO] core [INFO] examples [INFO] sandbox [INFO] - --- [INFO] Building Commons VFS (project) [INFO]task-segment: [clean, install] [INFO] - --- [INFO] [clean:clean] [INFO] Deleting directory /home/jcarman/commons-vfs/target [INFO] Deleting directory /home/jcarman/commons-vfs/target/classes [INFO] Deleting directory /home/jcarman/commons-vfs/target/test-classes [INFO] [antrun:run {execution: default}] [INFO] Executing tasks [copy] Copying 2 files to /home/jcarman/commons-vfs/target/classes/META-INF [INFO] Executed tasks [INFO] [site:attach-descriptor] [INFO] [install:install] [INFO] Installing /home/jcarman/commons-vfs/pom.xml to /home/jcarman/.m2/reposit ory/org/apache/commons/commons-vfs-project/1.1-SNAPSHOT/commons- vfs-project-1.1- SNAPSHOT.pom [INFO] - --- [INFO] Building core [INFO]task-segment: [clean, install] [INFO] - --- [INFO] [clean:clean] [INFO] Deleting directory /home/jcarman/commons-vfs/core/target [INFO] Deleting directory /home/jcarman/commons-vfs/core/target/classes [INFO] Deleting directory /home/jcarman/commons-vfs/core/target/test-classes [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] Compiling 218 source files to /home/jcarman/commons-vfs/core/target/classes [INFO] [antrun:run {execution: default}] [INFO] Executing tasks [echo] Setup test-data environment [copy] Copying 30 files to /home/jcarman/commons-vfs/core/target/classes/te st-data [INFO] Executed tasks [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] Compiling 58 source files to /home/jcarman/commons-vfs/core/target/test-classes [INFO] [surefire:test] [INFO] Surefire report directory: /home/jcarman/commons-vfs/core/target/surefire -reports --- T E S T S --- Running org.apache.commons.vfs.provider.ram.test.RamProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.109 sec Running org.apache.commons.vfs.provider.http.test.HttpProviderTestCaseTests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.069 sec Running org.apache.commons.vfs.provider.url.test.UrlHttpProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec Running org.apache.commons.vfs.provider.ftp.test.FtpProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec Running org.apache.commons.vfs.provider.tar.test.TgzProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.014 sec Running org.apache.commons.vfs.provider.local.test.LocalProviderTestCaseTests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec Running org.apache.commons.vfs.RunTest Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.081 sec May 21, 2007 1:13:24 PM org.apache.commons.vfs.VfsLog info INFO: Using /tmp/vfs_cache as temporary files store. Running org.apache.commons.vfs.provider.jar.test.JarProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.026 sec Running org.apache.commons.vfs.provider.tar.test.NestedTarTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.116 sec Running org.apache.commons.vfs.test.FileSystemManagerFactoryTestCase Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.305 sec FA ILURE! Running org.apache.commons.vfs.provider.tar.test.Tbz2ProviderTestCaseTests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec Running org.apache.commons.vfs.provider.tar.test.NestedTbz2TestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec Running org.apache.commons.vfs.provider.url.test.UrlProviderHttpTestCaseTests run: 0, Failures:
Re: [vfs] trunk build fails?
I guess I should also offer my help if needed to fix it. :-) It's probably nothing major. I just didn't have time to dig and thought I'd send a quick note to see if anyone else has encountered it On 5/21/07, James Carman [EMAIL PROTECTED] wrote: Any ETA on when they'll be fixed? On 5/21/07, Mario Ivankovits [EMAIL PROTECTED] wrote: looks like the a test is failing. For now, please add -Dmaven.test.skip=true to your mvn cmd line as our tests do not really work with surefire (maven2) yet. Mario -Original Message- From: James Carman [EMAIL PROTECTED] Date: Monday, Mai 21, 2007 7:15 pm Subject: [vfs] trunk build fails? To: Reply-Jakarta Commons Developers List commons-dev@jakarta.apache.orgTo: Jakarta Commons Developers List commons-dev@jakarta.apache.org I am trying to install VFS into our local maven repository (we require WebDAV support, so we need the sandbox) and I can't get a clean build using Maven2. I checkout, cd to the directory, and run a mvn install and I get... [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] Commons VFS (project) [INFO] core [INFO] examples [INFO] sandbox [INFO] - --- [INFO] Building Commons VFS (project) [INFO]task-segment: [clean, install] [INFO] - --- [INFO] [clean:clean] [INFO] Deleting directory /home/jcarman/commons-vfs/target [INFO] Deleting directory /home/jcarman/commons-vfs/target/classes [INFO] Deleting directory /home/jcarman/commons-vfs/target/test-classes [INFO] [antrun:run {execution: default}] [INFO] Executing tasks [copy] Copying 2 files to /home/jcarman/commons-vfs/target/classes/META-INF [INFO] Executed tasks [INFO] [site:attach-descriptor] [INFO] [install:install] [INFO] Installing /home/jcarman/commons-vfs/pom.xml to /home/jcarman/.m2/reposit ory/org/apache/commons/commons-vfs-project/1.1-SNAPSHOT/commons- vfs-project-1.1 - SNAPSHOT.pom [INFO] - --- [INFO] Building core [INFO]task-segment: [clean, install] [INFO] - --- [INFO] [clean:clean] [INFO] Deleting directory /home/jcarman/commons-vfs/core/target [INFO] Deleting directory /home/jcarman/commons-vfs/core/target/classes [INFO] Deleting directory /home/jcarman/commons-vfs/core/target/test-classes [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] Compiling 218 source files to /home/jcarman/commons-vfs/core/target/classes [INFO] [antrun:run {execution: default}] [INFO] Executing tasks [echo] Setup test-data environment [copy] Copying 30 files to /home/jcarman/commons-vfs/core/target/classes/te st-data [INFO] Executed tasks [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] Compiling 58 source files to /home/jcarman/commons-vfs/core/target/test-classes [INFO] [surefire:test] [INFO] Surefire report directory: /home/jcarman/commons-vfs/core/target/surefire -reports --- T E S T S --- Running org.apache.commons.vfs.provider.ram.test.RamProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.109sec Running org.apache.commons.vfs.provider.http.test.HttpProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.069 sec Running org.apache.commons.vfs.provider.url.test.UrlHttpProviderTestCaseTests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec Running org.apache.commons.vfs.provider.ftp.test.FtpProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008sec Running org.apache.commons.vfs.provider.tar.test.TgzProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.014sec Running org.apache.commons.vfs.provider.local.test.LocalProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec Running org.apache.commons.vfs.RunTest Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.081sec May 21, 2007 1:13:24 PM org.apache.commons.vfs.VfsLog info INFO: Using /tmp/vfs_cache as temporary files store. Running org.apache.commons.vfs.provider.jar.test.JarProviderTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.026sec Running org.apache.commons.vfs.provider.tar.test.NestedTarTestCase Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.116sec Running org.apache.commons.vfs.test.FileSystemManagerFactoryTestCase Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.305sec FA ILURE! Running
[jira] Commented: (LANG-335) Comparisons of Dates and Calendars to second precision
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497532 ] Gary Gregory commented on LANG-335: --- Would Joda-TIme help here? Comparisons of Dates and Calendars to second precision -- Key: LANG-335 URL: https://issues.apache.org/jira/browse/LANG-335 Project: Commons Lang Issue Type: New Feature Affects Versions: 2.3 Environment: Windows, JDK 1.6.0, Eclipse 3.2 Reporter: Alex Marshall Priority: Trivial The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Created: (JELLY-277) XMLParser.configure is not threadsafe.
XMLParser.configure is not threadsafe. -- Key: JELLY-277 URL: https://issues.apache.org/jira/browse/JELLY-277 Project: Commons Jelly Issue Type: Bug Components: core / taglib.core Affects Versions: 1.0 Environment: Linux 64bits, JDK build 1.6.0_01-b06 Reporter: Yung-Lin Ho XMLParser will try to load jelly.properties from disk when it first being used. However, because XMLParser.configure method is not threadsafe, when I tried to return multiple jelly scripts/instance at the same time, XMLParser threw out the following error message java.lang.ClassNotFoundException: core at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1166) at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1107) at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:977) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.apache.commons.jelly.parser.XMLParser.createTag(XMLParser.java:985) java.lang.ClassNotFoundException: core at org.apache.commons.jelly.parser.XMLParser.createSAXException(XMLParser.java:1180) at org.apache.commons.jelly.parser.XMLParser.createTag(XMLParser.java:990) at org.apache.commons.jelly.parser.XMLParser.startElement(XMLParser.java:593) In order to fix this problem, we have to make ensureConfigured() and configure() synchronized methods. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r540225 - in /jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath: XmlPreserveSpace.xml ri/model/XMLPreserveSpaceTest.java
Author: mbenson Date: Mon May 21 11:37:59 2007 New Revision: 540225 URL: http://svn.apache.org/viewvc?view=revrev=540225 Log: more xml:space tests Added: jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/XmlPreserveSpace.xml (with props) jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/XMLPreserveSpaceTest.java (with props) Added: jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/XmlPreserveSpace.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/XmlPreserveSpace.xml?view=autorev=540225 == --- jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/XmlPreserveSpace.xml (added) +++ jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/XmlPreserveSpace.xml Mon May 21 11:37:59 2007 @@ -0,0 +1,47 @@ +?xml version=1.0 ? +!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the License); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an AS IS BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-- + +!DOCTYPE test [ + !ELEMENT test (text) + !ELEMENT text ANY + !ATTLIST text xml:space (default|preserve) 'preserve' +] + +test + text id=unspecified foo /text + text id=default xml:space=default foo /text + text id=preserve xml:space=preserve foo /text + text id=nested xml:space=default + text foo /text + text;/text + text xml:space=default bar /text + text;/text + text xml:space=preserve baz /text + /text + text id=nested-with-comments xml:space=default + text foo /text + !-- comment 1 -- + text;/text + !-- comment 2 -- + text xml:space=default bar /text + !-- comment 3 -- + text;/text + !-- comment 4 -- + text xml:space=preserve baz /text + /text +/test \ No newline at end of file Propchange: jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/XmlPreserveSpace.xml -- svn:eol-style = native Added: jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/XMLPreserveSpaceTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/XMLPreserveSpaceTest.java?view=autorev=540225 == --- jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/XMLPreserveSpaceTest.java (added) +++ jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/XMLPreserveSpaceTest.java Mon May 21 11:37:59 2007 @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.jxpath.ri.model; + +import org.apache.commons.jxpath.JXPathContext; +import org.apache.commons.jxpath.JXPathTestCase; +import org.apache.commons.jxpath.xml.DocumentContainer; + +/** + * Test for text trimming from JXPATH-83. + * + * @author Matt Benson + * @version $Revision:$ $Date:$ + */ +public class XMLPreserveSpaceTest extends JXPathTestCase { +protected JXPathContext context; + +/** + * Construct a new instance of this test case. + * + * @param name Name of the test case + */ +public XMLPreserveSpaceTest(String name) { +super(name); +
[jira] Commented: (LANG-335) Comparisons of Dates and Calendars to second precision
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497544 ] Alex Marshall commented on LANG-335: You need to be very careful about copying other peoples work since if you infringe someone elses intellectual property rights then you are at risk of being sued. Ok, fair enough. I'll be the first to admit that I wasn't sufficiently prudent, but I still think this is a bit of functionality that many developers could benefit from and that it should be included with DateUtils Comparisons of Dates and Calendars to second precision -- Key: LANG-335 URL: https://issues.apache.org/jira/browse/LANG-335 Project: Commons Lang Issue Type: New Feature Affects Versions: 2.3 Environment: Windows, JDK 1.6.0, Eclipse 3.2 Reporter: Alex Marshall Priority: Trivial The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jira] Commented: (LANG-335) Comparisons of Dates and Calendars to second precision
I've looked at the Joda-Time API and it doesn't look like there's anything that would be nearly as efficient as the simple bit-math that's used to do the calculations in the JDK implementation. Admittedly I'm not that familiar with the library, so if there is a better way, I'm open to being corrected. Alex Marshall Software Developer Email: [EMAIL PROTECTED] MSN Messenger: [EMAIL PROTECTED] ICQ:137350791 Skype username: alex.marshall Office: 1-888-286-2010 Ext 229 Fax:1-780-484-0538 CONFIDENTIAL: This message, including any attachments, may contain confidential and/or privileged information, which is intended solely for the use of the addressee(s). Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, please contact the sender and destroy all copies of the original message. Gary Gregory (JIRA) wrote: [ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497532 ] Gary Gregory commented on LANG-335: --- Would Joda-TIme help here? Comparisons of Dates and Calendars to second precision -- Key: LANG-335 URL: https://issues.apache.org/jira/browse/LANG-335 Project: Commons Lang Issue Type: New Feature Affects Versions: 2.3 Environment: Windows, JDK 1.6.0, Eclipse 3.2 Reporter: Alex Marshall Priority: Trivial The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Created: (CONFIGURATION-269) PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled
PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled -- Key: CONFIGURATION-269 URL: https://issues.apache.org/jira/browse/CONFIGURATION-269 Project: Commons Configuration Issue Type: Bug Affects Versions: 1.4 Reporter: Oliver Heger Assigned To: Oliver Heger Fix For: 1.5 PropertiesConfiguration.save() ignores the delimiter parsing disabled flag and escapes all delimiter characters it encounters. When the configuration is loaded again (with delimiter parsing disabled) the values of affected properties contain the escaping character. This bug is very similar to CONFIGURATION-268, but for PropertiesConfiguration. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r540278 - in /jakarta/commons/proper/jxpath/trunk/src: java/org/apache/commons/jxpath/ java/org/apache/commons/jxpath/ri/ java/org/apache/commons/jxpath/ri/axes/ java/org/apache/commons/jx
Author: mbenson Date: Mon May 21 13:38:45 2007 New Revision: 540278 URL: http://svn.apache.org/viewvc?view=revrev=540278 Log: revert changes for JXPATH-61 Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/NamespaceResolver.java jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/SimplePathInterpreter.java jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/Path.java jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dom/DOMNodePointer.java jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNodePointer.java jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/Vendor.xml jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/XMLModelTestCase.java Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java?view=diffrev=540278r1=540277r2=540278 == --- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java (original) +++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java Mon May 21 13:38:45 2007 @@ -850,30 +850,4 @@ Namespace registration is not implemented by + getClass()); } -/** - * Binds a namespace URI for XPath QNames that are missing the prefix. - * If you have this XML: - * pre - * lt;a xmlns=mynsgt; - * lt;bgt;109lt;/bgt; - * lt;/agt; - * /pre - * and - * pre - * context.setDefaultNamespaceURI(myns); - * /pre - * you can use the path /a/b instead of /foo:a/foo:b (the assumption - * here is that the prefix foo is bound to myns by calling - * registerNamespace). - */ -public void registerDefaultNamespace(String uri) { -throw new UnsupportedOperationException( -Namespace registration is not implemented by + getClass()); -} - -/** -*/ -public String getDefaultNamespaceURI() { -return null; -} } Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java?view=diffrev=540278r1=540277r2=540278 == --- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java (original) +++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java Mon May 21 13:38:45 2007 @@ -114,7 +114,6 @@ private Pointer contextPointer; protected NamespaceResolver namespaceResolver; -private String defaultNamespaceURI; // The frequency of the cache cleanup private static final int CLEANUP_THRESHOLD = 500; @@ -686,24 +685,9 @@ public NamespaceResolver getNamespaceResolver() { namespaceResolver.seal(); - namespaceResolver.registerDefaultNamespaceURI(getDefaultNamespaceURI()); return namespaceResolver; } -public String getDefaultNamespaceURI() { -if (defaultNamespaceURI != null) { -return defaultNamespaceURI; -} -if (parentContext != null) { -return parentContext.getDefaultNamespaceURI(); -} -return null; -} - -public void registerDefaultNamespace(String uri) { -defaultNamespaceURI = uri; -} - /** * Checks if existenceCheckClass exists on the class path. If so, allocates * an instance of the specified class, otherwise returns null. Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/NamespaceResolver.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/NamespaceResolver.java?view=diffrev=540278r1=540277r2=540278 == --- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/NamespaceResolver.java (original) +++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/NamespaceResolver.java Mon May 21 13:38:45 2007 @@ -36,7 +36,6 @@ protected HashMap namespaceMap = new HashMap(); protected HashMap reverseMap; protected NodePointer pointer; -
svn commit: r540288 - /jakarta/commons/proper/jxpath/trunk/xdocs/users-guide.xml
Author: mbenson Date: Mon May 21 13:47:34 2007 New Revision: 540288 URL: http://svn.apache.org/viewvc?view=revrev=540288 Log: document some stuff and correct 2 misspellings Modified: jakarta/commons/proper/jxpath/trunk/xdocs/users-guide.xml Modified: jakarta/commons/proper/jxpath/trunk/xdocs/users-guide.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/xdocs/users-guide.xml?view=diffrev=540288r1=540287r2=540288 == --- jakarta/commons/proper/jxpath/trunk/xdocs/users-guide.xml (original) +++ jakarta/commons/proper/jxpath/trunk/xdocs/users-guide.xml Mon May 21 13:47:34 2007 @@ -701,7 +701,7 @@ the same as the child:: axis. /p p - The only two distinctions are the xml:lang and name. + The only distinctions are xml:lang, xml:space, and name. /p p Attribute codexml:lang/code refers to the name of the locale @@ -711,6 +711,18 @@ explicitly set it is the application's default locale. /p p + Since version 1.3, the codexml:space/code attribute can be used + in an XML model to direct JXPath's interpretation of embedded + whitespace among XML content and nested text. In previous versions + this data was trimmed, and this has been preserved as the default + behavior for reasons of backward compatibility. Specifying + codexml:space=preserve/code will cause JXPath to preserve + whitespace. Keep in mind that it is possible to specify default + attribute values using DTD or XML schema, so that there exists a + straightforward and standards-based way to enable whitespace + preservation by default at the document or element level. +/p +p The codename/code attribute is primarily used when working with Maps. Often elements of a Map can be retrieved using the child:: axis. For example, if foo in codefoo/bar/code @@ -1189,7 +1201,7 @@ Collections of custom extension functions can be implemented as a href=apidocs/org/apache/commons/jxpath/Functions.htmlcodeFunctions/code/a - objects or as Java classes, whose methods become extenstion + objects or as Java classes, whose methods become extension functions. /p p @@ -1254,7 +1266,7 @@ !-- + SOURCE + -- source b/ -public class MyExtenstionFunctions { +public class MyExtensionFunctions { public static boolean isDate(ExpressionContext context){ Pointer pointer = context.getContextNodePointer(); if (pointer == null){ @@ -1295,13 +1307,13 @@ NodeSet, in addition to providing access to the values, also provides access to pointers. Note that a collection is often passed to an extension function by value and - cannot be modified. + cannot be modified. /p !-- + SOURCE + -- source b/ -public class MyExtenstionFunctions { +public class MyExtensionFunctions { ... public static boolean contains(NodeSet nodeSet, Object value){ Iterator iter = nodeSet.getPointers().iterator(); @@ -1341,6 +1353,21 @@ /source !-- - SOURCE - -- +p + In JXPath version 1.1, a function argument declared as Object would be + passed as a NodeSet. In version 1.2, this behavior was changed such + that a declared argument type of Object triggers the conversion of + the NodeSet to its list of values. The simplest way to avoid this + conversion, thereby receiving the untouched NodeSet as the function + argument, is to declare the argument as a NodeSet. For such times as + this may prove impractical, however, a version 1.1-compatible + TypeConverter implementation, + (org.apache.commons.jxpath.util.JXPath11CompatibleTypeConverter), + has been provided in version 1.3. To enable this: +/p +source +TypeUtils.setTypeConverter(new JXPath11CompatibleTypeConverter()); +/source /subsection subsection name=Collection as the Return Value p @@ -1736,4 +1763,4 @@ /subsection /section /body -/document \ No newline at end of file +/document - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Resolved: (JXPATH-61) [jxpath] Default Namespace not handled correctly
[ https://issues.apache.org/jira/browse/JXPATH-61?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matt Benson resolved JXPATH-61. --- Resolution: Won't Fix Fix Version/s: (was: 1.3) Final result: reverting related changes per majority consensus on this thread with strong influence from ERH as a recognized expert in the XML field. See http://marc.info/?l=jakarta-commons-devm=117193684907951w=2 [jxpath] Default Namespace not handled correctly Key: JXPATH-61 URL: https://issues.apache.org/jira/browse/JXPATH-61 Project: Commons JXPath Issue Type: Improvement Affects Versions: 1.2 Final Environment: Operating System: All Platform: All Reporter: Richard Unger Priority: Minor JXPath 1.2 does not handle the default namespace correctly. There is no way to set the default namespace on a context, so xpath expressions with unprefixed node-selections do not match the default namespace. Eg: ?xml version=1.0 encoding=iso-8859-1? test xmlns=http://test; child-element / /test This is valid xml, with default namespace 'http://test' If the following xpath expression is used: '/test/childelement', it will not match the child-element element in this xml file. There appears to be no way to use the function JXPathContext.registerNamespace() to associate a default namespace with the context. The programmer is forced to introduce a namespace prefix for JXPath, the xpath expression 'foo:test/foo:child-element' will correctly match the element if JXPathContext.registerNamespace(foo,http://test;) is called first. This is, IMHO, a bug. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [jira] Commented: (LANG-335) Comparisons of Dates and Calendars to second precision
Hello: I am pointing to Joda-Time in general for date and time issues as it is a comprehensive open source solution. It is my understanding that we have not enhanced [lang] in this department because we do not want to end up with a Joda-Time-like component within [lang]. Thank you, Gary From: Alex Marshall [mailto:[EMAIL PROTECTED] Sent: Monday, May 21, 2007 12:01 PM To: Jakarta Commons Developers List Subject: Re: [jira] Commented: (LANG-335) Comparisons of Dates and Calendars to second precision I've looked at the Joda-Time API and it doesn't look like there's anything that would be nearly as efficient as the simple bit-math that's used to do the calculations in the JDK implementation. Admittedly I'm not that familiar with the library, so if there is a better way, I'm open to being corrected. Alex Marshall Software Developer Email:[EMAIL PROTECTED]mailto:[EMAIL PROTECTED] MSN Messenger: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] ICQ: 137350791 Skype username: alex.marshall Office: 1-888-286-2010 Ext 229 Fax: 1-780-484-0538 CONFIDENTIAL: This message, including any attachments, may contain confidential and/or privileged information, which is intended solely for the use of the addressee(s). Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, please contact the sender and destroy all copies of the original message. Gary Gregory (JIRA) wrote: [ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497532 ] Gary Gregory commented on LANG-335: --- Would Joda-TIme help here? Comparisons of Dates and Calendars to second precision -- Key: LANG-335 URL: https://issues.apache.org/jira/browse/LANG-335 Project: Commons Lang Issue Type: New Feature Affects Versions: 2.3 Environment: Windows, JDK 1.6.0, Eclipse 3.2 Reporter: Alex Marshall Priority: Trivial The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)
[jira] Commented: (CONFIGURATION-269) PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled
[ https://issues.apache.org/jira/browse/CONFIGURATION-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497582 ] Emmanuel Bourg commented on CONFIGURATION-269: -- The best solution is to split the property on several lines. I can work on this Oliver if you haven't started yet. PropertiesConfiguration.save() generates superfluous escaping character when delimiter parsing is disabled -- Key: CONFIGURATION-269 URL: https://issues.apache.org/jira/browse/CONFIGURATION-269 Project: Commons Configuration Issue Type: Bug Affects Versions: 1.4 Reporter: Oliver Heger Assigned To: Oliver Heger Fix For: 1.5 PropertiesConfiguration.save() ignores the delimiter parsing disabled flag and escapes all delimiter characters it encounters. When the configuration is loaded again (with delimiter parsing disabled) the values of affected properties contain the escaping character. This bug is very similar to CONFIGURATION-268, but for PropertiesConfiguration. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jxpath] release plan
AFAIK JXPath JIRA is in fine shape. Only two open enhancement requests, both of which have been deemed to be major-version caliber changes. As a newcomer to Jakarta and a maven novice, I am now seeking input from the community on the process of building an RC and following through for a release of Commons JXPath 1.3 . TIA, Matt Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool. http://autos.yahoo.com/carfinder/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r540328 - in /jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters: DateTimeConverter.java NumberConverter.java
Author: niallp Date: Mon May 21 15:34:43 2007 New Revision: 540328 URL: http://svn.apache.org/viewvc?view=revrev=540328 Log: Add getters for properties to Date and Number converters Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/NumberConverter.java Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java?view=diffrev=540328r1=540327r2=540328 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java Mon May 21 15:34:43 2007 @@ -126,6 +126,16 @@ } /** + * Return the Time Zone to use when converting dates + * (or codenull/code if none specified. + * + * @return The Time Zone. + */ +public TimeZone getTimeZone() { +return timeZone; +} + +/** * Set the Time Zone to use when converting dates. * * @param timeZone The Time Zone. @@ -135,6 +145,16 @@ } /** + * Return the Locale for the iConverter/i + * (or codenull/code if none specified). + * + * @return The locale to use for conversion + */ +public Locale getLocale() { +return locale; +} + +/** * Set the Locale for the iConverter/i. * * @param locale The Locale. @@ -153,6 +173,18 @@ */ public void setPattern(String pattern) { setPatterns(new String[] {pattern}); +} + +/** + * Return the date format patterns used to convert + * dates to/from a codejava.lang.String/code + * (or codenull/code if none specified). + * + * @see SimpleDateFormat + * @return Array of format patterns. + */ +public String[] getPatterns() { +return patterns; } /** Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/NumberConverter.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/NumberConverter.java?view=diffrev=540328r1=540327r2=540328 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/NumberConverter.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/NumberConverter.java Mon May 21 15:34:43 2007 @@ -125,6 +125,15 @@ // - Public Methods /** + * Return whether decimals are allowed in the number. + * + * @return Whether decimals are allowed in the number + */ +public boolean isAllowDecimals() { +return allowDecimals; +} + +/** * Set whether a format should be used to convert * the Number. * @@ -136,6 +145,20 @@ } /** + * Return the number format pattern used to convert + * Numbers to/from a codejava.lang.String/code + * (or codenull/code if none specified). + * p + * See codejava.text.SimpleDateFormat/code for details + * of how to specify the pattern. + * + * @return The format pattern. + */ +public String getPattern() { +return pattern; +} + +/** * Set a number format pattern to use to convert * Numbers to/from a codejava.lang.String/code. * p @@ -150,9 +173,19 @@ } /** + * Return the Locale for the iConverter/i + * (or codenull/code if none specified). + * + * @return The locale to use for conversion + */ +public Locale getLocale() { +return locale; +} + +/** * Set the Locale for the iConverter/i. * - * @param locale The default Locale. + * @param locale The locale to use for conversion */ public void setLocale(Locale locale) { this.locale = locale; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r540362 - in /jakarta/commons/proper/beanutils/trunk/src: java/org/apache/commons/beanutils/ test/org/apache/commons/beanutils/
Author: niallp Date: Mon May 21 16:36:17 2007 New Revision: 540362 URL: http://svn.apache.org/viewvc?view=revrev=540362 Log: Fix for BEANUTILS-266 Log or throw exception in PropertyUtilsBean - thanks to Brian Ewins and Commons HttpClient. Added mechanism to initialize the cause on an Exception using reflection (copied from Commons HttpClient). Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BeanUtils.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BeanUtilsBean.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/PropertyUtilsBean.java jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/BeanUtilsTestCase.java Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BeanUtils.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BeanUtils.java?view=diffrev=540362r1=540361r2=540362 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BeanUtils.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BeanUtils.java Mon May 21 16:36:17 2007 @@ -455,4 +455,15 @@ BeanUtilsBean.getInstance().setProperty(bean, name, value); } + +/** + * If we're running on JDK 1.4 or later, initialize the cause for the given throwable. + * + * @param throwable The throwable. + * @param cause The cause of the throwable. + * @return true if the cause was initialized, otherwise false. + */ +public static boolean initCause(Throwable throwable, Throwable cause) { +return BeanUtilsBean.getInstance().initCause(throwable, cause); +} } Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BeanUtilsBean.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BeanUtilsBean.java?view=diffrev=540362r1=540361r2=540362 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BeanUtilsBean.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BeanUtilsBean.java Mon May 21 16:36:17 2007 @@ -23,6 +23,7 @@ import java.beans.PropertyDescriptor; import java.lang.reflect.Array; import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -103,6 +104,9 @@ /** Used to access properties*/ private PropertyUtilsBean propertyUtilsBean; +/** A reference to Throwable's initCause method, or null if it's not there in this JVM */ +private static final Method INIT_CAUSE_METHOD = getInitCauseMethod(); + // - Constuctors /** @@ -1028,5 +1032,51 @@ */ public PropertyUtilsBean getPropertyUtils() { return propertyUtilsBean; +} + +/** + * If we're running on JDK 1.4 or later, initialize the cause for the given throwable. + * + * @param throwable The throwable. + * @param cause The cause of the throwable. + * @return true if the cause was initialized, otherwise false. + */ +public boolean initCause(Throwable throwable, Throwable cause) { +if (INIT_CAUSE_METHOD != null cause != null) { +try { +INIT_CAUSE_METHOD.invoke(throwable, new Object[] { cause }); +return true; +} catch (Throwable e) { +} +} +return false; +} + +/** + * Returns a codeMethodcode allowing access to + * [EMAIL PROTECTED] Throwable#initCause(Throwable)} method of [EMAIL PROTECTED] Throwable}, + * or codenull/code if the method + * does not exist. + * + * @return A codeMethodcode for codeThrowable.initCause/code, or + * codenull/code if unavailable. + */ +private static Method getInitCauseMethod() { +try { +Class[] paramsClasses = new Class[] { Throwable.class }; +return Throwable.class.getMethod(initCause, paramsClasses); +} catch (NoSuchMethodException e) { +Log log = LogFactory.getLog(BeanUtils.class); +if (log.isWarnEnabled()) { +log.warn(Throwable does not have initCause() method in JDK 1.3); +} +return null; +} catch (Throwable e) { +Log log = LogFactory.getLog(BeanUtils.class); +if (log.isWarnEnabled()) { +log.warn(Error getting the Throwable initCause() method, e); +} +return null; +} } } Modified:
[jira] Commented: (BEANUTILS-266) Log or throw exception in PropertyUtilsBean, not both
[ https://issues.apache.org/jira/browse/BEANUTILS-266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497636 ] Niall Pemberton commented on BEANUTILS-266: --- Thanks for the suggestion - I used the HttpClient code. The only problem is I can't actually get PropertyUtilsBean's invoke method to throw an IllegalArgumentException in that place - other types of exceptions yes, but not that one. Looking at the code though I don't know why its only catching IllegalArgumentException and not any error. Any chance you could provide a test case that causes this? Log or throw exception in PropertyUtilsBean, not both - Key: BEANUTILS-266 URL: https://issues.apache.org/jira/browse/BEANUTILS-266 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Affects Versions: 1.7.0 Environment: all Reporter: Brian Ewins Priority: Minor Fix For: 1.8.0 This commit (related to BEANUTILS-224): http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/PropertyUtilsBean.java?view=diffr1=471989r2=471990 improved the error message for illegal arguments, but also introduced a log message for that same exception. Best practice is to log or throw but not both, since this often results in the error being logged multiple times - when it was created and when the exception is caught. In addition this is logging the problem as an error when it may in fact be handled by the caller, so at worst its a debug-level message. I switched up to 1.7 recently and this has been filling up my logs. I know I can work around it by disabling logging for this component but the existence of this log message seems like an oversight. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r540380 - /jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/PropertyUtilsTestCase.java
Author: niallp Date: Mon May 21 17:23:27 2007 New Revision: 540380 URL: http://svn.apache.org/viewvc?view=revrev=540380 Log: BEANUTILS-266 - add a test case to check that PropertyUtilsBean's invoke method is correctly initializing the cause on JDK 1.4+ Modified: jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/PropertyUtilsTestCase.java Modified: jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/PropertyUtilsTestCase.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/PropertyUtilsTestCase.java?view=diffrev=540380r1=540379r2=540380 == --- jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/PropertyUtilsTestCase.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/PropertyUtilsTestCase.java Mon May 21 17:23:27 2007 @@ -25,6 +25,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.StringTokenizer; import org.apache.commons.beanutils.priv.PrivateBeanFactory; import org.apache.commons.beanutils.priv.PrivateDirect; @@ -3825,5 +3826,43 @@ myMap.put(thebean, bean); utilsBean.getNestedProperty(myMap, thebean.mapitem); utilsBean.getNestedProperty(myMap, thebean(mapitem)); +} + +/** + * Test [EMAIL PROTECTED] PropertyUtilsBean}'s invoke method throwing an IllegalArgumentException + * and check that the cause has been properly initialized for JDK 1.4+ + * See BEANUTILS-266 for changes and reason for test + */ +public void testExceptionFromInvoke() throws Exception { +if (isPre14JVM()) { +return; +} +try { +PropertyUtils.setSimpleProperty(bean, intProperty,XXX); +} catch(IllegalArgumentException t) { +Throwable cause = (Throwable)PropertyUtils.getProperty(t, cause); +assertNotNull(Cause not found, cause); +assertTrue(Expected cause to be IllegalArgumentException, but was: + cause.getClass(), +cause instanceof IllegalArgumentException); +assertEquals(Check error message, argument type mismatch, cause.getMessage()); +} catch(Throwable t) { +fail(Expected IllegalArgumentException, but threw + t); +} +} + +/** + * Test for JDK 1.4 + */ +private boolean isPre14JVM() { +String version = System.getProperty(java.specification.version); +StringTokenizer tokenizer = new StringTokenizer(version,.); +if (tokenizer.nextToken().equals(1)) { +String minorVersion = tokenizer.nextToken(); +if (minorVersion.equals(0)) return true; +if (minorVersion.equals(1)) return true; +if (minorVersion.equals(2)) return true; +if (minorVersion.equals(3)) return true; +} +return false; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Resolved: (BEANUTILS-266) Log or throw exception in PropertyUtilsBean, not both
[ https://issues.apache.org/jira/browse/BEANUTILS-266?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton resolved BEANUTILS-266. --- Resolution: Fixed Assignee: Niall Pemberton Sorry forget that - I've re-produced and added a test - closing as fixed Log or throw exception in PropertyUtilsBean, not both - Key: BEANUTILS-266 URL: https://issues.apache.org/jira/browse/BEANUTILS-266 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Affects Versions: 1.7.0 Environment: all Reporter: Brian Ewins Assigned To: Niall Pemberton Priority: Minor Fix For: 1.8.0 This commit (related to BEANUTILS-224): http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/PropertyUtilsBean.java?view=diffr1=471989r2=471990 improved the error message for illegal arguments, but also introduced a log message for that same exception. Best practice is to log or throw but not both, since this often results in the error being logged multiple times - when it was created and when the exception is caught. In addition this is logging the problem as an error when it may in fact be handled by the caller, so at worst its a debug-level message. I switched up to 1.7 recently and this has been filling up my logs. I know I can work around it by disabling logging for this component but the existence of this log message seems like an oversight. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-273) Public methods overriden in anonymous or private subclasses are not recognized by PropertyUtils
[ https://issues.apache.org/jira/browse/BEANUTILS-273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-273: -- Fix Version/s: 1.8.0 Public methods overriden in anonymous or private subclasses are not recognized by PropertyUtils --- Key: BEANUTILS-273 URL: https://issues.apache.org/jira/browse/BEANUTILS-273 Project: Commons BeanUtils Issue Type: Bug Components: Bean / Property Utils Affects Versions: 1.7.0 Reporter: Marcelo Liberato Fix For: 1.8.0 Attachments: anonymous-subclass-override-patch.txt When you do something like: TestBean anonymous = new TestBean() { public String getStringProperty() { return foo; } }; PropertyUtils.getProperty(anonymous, stringProperty); PropertyUtils fails as: java.lang.NoSuchMethodException: Property 'stringProperty' has no getter method in class 'class org.apache.commons.beanutils.PropertyUtilsTestCase$1' -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-272) ConstructorUtils.getMatchingAccessibleConstructor() should be made public
[ https://issues.apache.org/jira/browse/BEANUTILS-272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-272: -- Fix Version/s: LATER THAN 1.8.0 Priority: Minor (was: Major) ConstructorUtils.getMatchingAccessibleConstructor() should be made public - Key: BEANUTILS-272 URL: https://issues.apache.org/jira/browse/BEANUTILS-272 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Affects Versions: 1.7.0 Reporter: Purush Rudrakshala Priority: Minor Fix For: LATER THAN 1.8.0 ConstructorUtils.getMatchingAccessibleConstructor() should be changed to public static from current private static. It would be useful to determine if a constructor is available matching specified parameter types. Currently, invokeConstructor() needs to be called unnecessarily creating a new object just to check if matching constructor is available. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-271) [beanutils] converters - DateLocaleConverter does not always throw an Exception for invalid dates
[ https://issues.apache.org/jira/browse/BEANUTILS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-271: -- Fix Version/s: 1.8.0 [beanutils] converters - DateLocaleConverter does not always throw an Exception for invalid dates - Key: BEANUTILS-271 URL: https://issues.apache.org/jira/browse/BEANUTILS-271 Project: Commons BeanUtils Issue Type: Bug Components: Locale BeanUtils / Converters Affects Versions: 1.7.0 Environment: jdk1.5 Reporter: Nico Hoogervorst Priority: Minor Fix For: 1.8.0 Attachments: DateConverter.java example pattern: MMdd example value : 2007011x is accepted. The 'x' is ignored. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-270) findPropertyDescriptor method with a class argument
[ https://issues.apache.org/jira/browse/BEANUTILS-270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-270: -- Fix Version/s: LATER THAN 1.8.0 findPropertyDescriptor method with a class argument --- Key: BEANUTILS-270 URL: https://issues.apache.org/jira/browse/BEANUTILS-270 Project: Commons BeanUtils Issue Type: Wish Components: Bean / Property Utils Affects Versions: 1.7.0 Reporter: Matthias Wuttke Priority: Minor Fix For: LATER THAN 1.8.0 I would like to suggest to add a findPropertyDescriptor variant that takes a class instead of a bean as an argument. This is useful for situations where I want to deal with abstract classes and their properties as I cannot instantiate them to use findPropertyDescriptor(Object, String) public PropertyDescriptor findPropertyDescriptor(Class clazz, String propertyName) { PropertyDescriptor[] descriptors = PropertyUtils.getPropertyDescriptors(clazz); for (int i = 0; i descriptors.length; i++) if (propertyName.equals(descriptors[i].getName())) return (descriptors[i]); return null; } Best regards, Matthias -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-178) New implementation in commons-beanutils
[ https://issues.apache.org/jira/browse/BEANUTILS-178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-178: -- Comment: was deleted New implementation in commons-beanutils --- Key: BEANUTILS-178 URL: https://issues.apache.org/jira/browse/BEANUTILS-178 Project: Commons BeanUtils Issue Type: Improvement Components: DynaBean Affects Versions: 1.6 Environment: Operating System: All Platform: All Reporter: Fabio Lourencetti Gonçalves Priority: Minor Fix For: 1.8.0 NOTE: Seem to have lost the comment for this issue when transferring from Bugzilla to Jira - I'll copy yhe comments in here -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-178) New implementation in commons-beanutils
[ https://issues.apache.org/jira/browse/BEANUTILS-178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-178: -- Description: NOTE: Seem to have lost the comment for this issue when transferring from Bugzilla to Jira - I'll copy yhe comments in here (was: typing...) Summary: New implementation in commons-beanutils (was: [beanutils] New implementation in commons-beanutils) On 2004-09-13 15:06 Fabio Lourencetti Gonçalves wrote: I'm facing a problem with beanutil using jtds jdbc driver (an open source driver for sql server.) The problem occurs in the class BasicDynaBean, method set(String name, Object value) when using this code below org.apache.commons.beanutils.RowSetDynaClass rsdc = new org.apache.commons.beanutils.RowSetDynaClass(resultSet); When a column is of text type, jtds driver returns a java.sql.Clob java type and it throws a ConversionException (Cannot convert value of type '...clob implementarion...' to property '...' of type 'java.lang.String'); I made an implementarion to this method as follows below. What do you think about? Tks. Fabio Sao Paulo/Brazil --- public void set(String name, Object value) { DynaProperty descriptor = getDynaProperty(name); if (value == null) { if (descriptor.getType().isPrimitive()) { throw new NullPointerException (Primitive value for ' + name + '); } } else if (!isAssignable(descriptor.getType(), value.getClass())) { if(value instanceof Clob descriptor.getType() == java.lang.String.class) { try { value = ((Clob)value).getSubString(1, (int)((Clob) value).length()); } catch(SQLException ex) { throw new ConversionException(Cannot convert value of type ' + value.getClass().getName() + ' (CLOB) to property ' + name + ' of type ' + descriptor.getType().getName() + '); } } else { throw new ConversionException(Cannot assign value of type ' + value.getClass().getName() + ' to property ' + name + ' of type ' + descriptor.getType().getName() + '); } } values.put(name, value); } New implementation in commons-beanutils --- Key: BEANUTILS-178 URL: https://issues.apache.org/jira/browse/BEANUTILS-178 Project: Commons BeanUtils Issue Type: Improvement Components: DynaBean Affects Versions: 1.6 Environment: Operating System: All Platform: All Reporter: Fabio Lourencetti Gonçalves Priority: Minor Fix For: 1.8.0 NOTE: Seem to have lost the comment for this issue when transferring from Bugzilla to Jira - I'll copy yhe comments in here -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-178) New implementation in commons-beanutils
[ https://issues.apache.org/jira/browse/BEANUTILS-178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-178: -- Description: typing... (was: NOTE: Seem to have lost the comment for this issue when transferring from Bugzilla to Jira - I'll copy yhe comments in here) New implementation in commons-beanutils --- Key: BEANUTILS-178 URL: https://issues.apache.org/jira/browse/BEANUTILS-178 Project: Commons BeanUtils Issue Type: Improvement Components: DynaBean Affects Versions: 1.6 Environment: Operating System: All Platform: All Reporter: Fabio Lourencetti Gonçalves Priority: Minor Fix For: 1.8.0 typing... -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-181) [beanutils] Default converter for LocaleConvertUtilsBean
[ https://issues.apache.org/jira/browse/BEANUTILS-181?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-181: -- Fix Version/s: (was: 1.8.0) LATER THAN 1.8.0 [beanutils] Default converter for LocaleConvertUtilsBean Key: BEANUTILS-181 URL: https://issues.apache.org/jira/browse/BEANUTILS-181 Project: Commons BeanUtils Issue Type: Improvement Components: Locale BeanUtils / Converters Affects Versions: 1.6.1 Environment: Operating System: other Platform: Other Reporter: Tulbiak Priority: Minor Fix For: LATER THAN 1.8.0 Attachments: BeanUtilsBean.java, LocaleBeanUtilsBean.java, LocaleConvertUtilsBean.java When using the LocaleBeanUtils instead of BeanUtils, i got this exception (my form has a radio button and a checkbox): org.apache.commons.beanutils.ConversionException: Cannot assign value of type 'java.lang.String' to property 'fixedEndDate' of type 'java.lang.Boolean' at org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:423) at org.apache.commons.beanutils.PropertyUtilsBean. setSimpleProperty(PropertyUtilsBean.java:1733) at org.apache.commons.beanutils.PropertyUtilsBean. setNestedProperty(PropertyUtilsBean.java:1648) at org.apache.commons.beanutils.PropertyUtilsBean. setProperty(PropertyUtilsBean.java:1677) at org.apache.commons.beanutils.locale.LocaleBeanUtilsBean. invokeSetter(LocaleBeanUtilsBean.java:826) at org.apache.commons.beanutils.locale.LocaleBeanUtilsBean. setProperty(LocaleBeanUtilsBean.java:631) at org.apache.commons.beanutils.locale.LocaleBeanUtilsBean. setProperty(LocaleBeanUtilsBean.java:565) at org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean. java:811) After some investigations, it seems there is no registration in LocaleConvertUtilsBean for Boolean (and may be others) and i can't manualy register the BooleanConverter (not a LocaleConverter). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-175) [beanutils] Handling of exceptions thrown during BeanUtils.populate
[ https://issues.apache.org/jira/browse/BEANUTILS-175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-175: -- Fix Version/s: (was: 1.8.0) LATER THAN 1.8.0 [beanutils] Handling of exceptions thrown during BeanUtils.populate --- Key: BEANUTILS-175 URL: https://issues.apache.org/jira/browse/BEANUTILS-175 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: All Platform: All Reporter: Eric Pabst Priority: Minor Fix For: LATER THAN 1.8.0 I run into a problem when using Struts to populate request parameters to a form's nested property when either the conversion from String to int (for example) fails or when the set method in the nested bean throws an exception such as IllegalArgumentException. I propose that we add a property to BeanUtilsBean for a new interface called something like PopulateExceptionHandler which will have a method something like void execute(Exception exception, Object bean, String propertyPath, Object value) Then, within BeanUtilsBean.populate, within the loop, it would catch any exception, and call the populateExceptionHandler's execute method with it (unwrapping InvocationTargetException's). The default handler would just rethrow it (or we could have no default handler, and if no handler is present, the BeanUtils method rethrows it). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-248) Code to create a JavaBean and set its properties from a Java Properties instance
[ https://issues.apache.org/jira/browse/BEANUTILS-248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-248: -- Fix Version/s: (was: 1.8.0) LATER THAN 1.8.0 Code to create a JavaBean and set its properties from a Java Properties instance Key: BEANUTILS-248 URL: https://issues.apache.org/jira/browse/BEANUTILS-248 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Coded on Windows XP professional with Netbean 5.5 Beta 2 using JDK 1.5.0 Reporter: Trevor Charles Miller Priority: Minor Fix For: LATER THAN 1.8.0 Attachments: BeanCreator.java The idea is simple and I've seen this done in Log4J and had a use case for it myself in another project. Given a set of properties, create an instance of a specified class and set properties on it. I think this could be very useful for runtime configuration. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-235) [beanutils] Need getPropertyType(Class theClass, String propName)
[ https://issues.apache.org/jira/browse/BEANUTILS-235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-235: -- Fix Version/s: (was: 1.8.0) LATER THAN 1.8.0 [beanutils] Need getPropertyType(Class theClass, String propName) - Key: BEANUTILS-235 URL: https://issues.apache.org/jira/browse/BEANUTILS-235 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Affects Versions: 1.5 Environment: Operating System: other Platform: Other Reporter: Andrea Aime Priority: Minor Fix For: LATER THAN 1.8.0 I've developed a small bean based TableModel, that I use to display list of beans in JTables. It works nicely as long as I don't need to display a nested property in the columns, thats why: the getColumnClass method passes only a columnIndex information and wants the Class of that column. If I use the getPropertyDescriptors I would need a lot of extra code to understand that a property is a nested one, load the correspondend class, and so on (and I think that this code is the job of BeanUtils), if I create a new istance of the class with Class.newIstance the dependent object are set to null and getPropertyType fails... So I think that it would be nice to complete the functionality of the PropertyUtils class with a getPropertyType(Class theClass, String propName) with the ability to handle also nested properties... -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-188) [beanutils] add collection modifiers feature to PropertyUtilsBean
[ https://issues.apache.org/jira/browse/BEANUTILS-188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-188: -- Fix Version/s: (was: 1.8.0) LATER THAN 1.8.0 [beanutils] add collection modifiers feature to PropertyUtilsBean - Key: BEANUTILS-188 URL: https://issues.apache.org/jira/browse/BEANUTILS-188 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: All Platform: All Reporter: Marc DeXeT Priority: Minor Fix For: LATER THAN 1.8.0 There's some java beans who are not lazy ones and who need to modify collection type properties. Ongoing propertyUtilsBean only allows to set indexed property, but not to add or remove items in collection. This is a proposition to add following new features : - propertyUtilsBean.(add | remove )CollectionPropertyValue(Object bean, String name, Object value) Action: (add to | remove from ) bean property name a value. In other words, search a method (add | remove)item(parameterType value) where parameterType.isAssignable(value.class) to add value to item collection, item collection bean property being deduced with a stemmer algo (as in betwixt.DefaultPluralStemmer) from method name and declared by getProperty(bean,name).getClass(); Sample : myPropertyUtilsBean.addCollectionPropertyValue(myBean, productMap(food).catalog.products, new Product(acmeDogFood, 12)); will use Catalog.addProduct(Product p) to add new Product(acmeDogFood, 12) to inner collection Catalog.products. - PropertyUtilsBean.(add | remove )CollectionPropertyValue(Object bean, String property, String itemName, Object value) Action: (add to | remove from ) bean property name a value. In other words, search a method (add | remove)item(parameterType value) where parameterType.isAssignable(value.class) to add value to item collection, item collection being deduced with a stemmer algo (as in betwixt.DefaultPluralStemmer) from itemName and declared by getProperty(bean,name).getClass(); Sample : myPropertyUtilsBean.addCollectionPropertyValue(myBean, productMap(food).catalog,product, new Product(acmeDogFood, 12)); will use Catalog.addProduct(Product p) to add new Product(acmeDogFood, 12) to inner Catalog.productList. If there's no Catalog.addProduct(Product p) method, try to invoke Collection.add(Object obj) on Catalog.products. I have yet created in PropertyUtilsBean sub class such feature as demonstrator and unit tests work (for the meantime). Constraints: - Object are to apply java beans specification. - Collection must have readable method ( to be considered as bean property) - adder and remover method have to follow conventions copied from org.apache.commons.betwixt.strategy.DefaultPluralStemmer Matching select in this order for an given itemName or a deduced from method name one: 1. get itemName+s :(items) 2. if ( itemName ends with y ) 1. get itemName+es (no sample, my english is too poor !) 2. get substitute itemName ending with ies (baby = babies) 3. get itemName + List 4. get itemName + Set 5. get itemName + Collection 6. Browse propertyMap to get a property starting with itemName, as itemBag. If there's several property matching later, select the longuest property name : itemBagCollection instead of itemBag - method selection : If two methods match this upper requirements (name (add | remove)Item(ParmType value) and parameterType.isAssignable(value.class)) , first method matching is selected. Methods are ordered following min distance metric : - Distance metric is the base on public int getDistance(Class c) { Class superclass = c.getSuperclass(); int distance = 0; while ( superclass != null ) { superclass = superclass.getSuperclass(); distance ++; } return distance; } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r540381 - /jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/
Author: niallp Date: Mon May 21 17:59:25 2007 New Revision: 540381 URL: http://svn.apache.org/viewvc?view=revrev=540381 Log: Improvements to AbstractConverter: - convertToString() to declare throwing Throwable (was declaring any errors on method signature) - convertToType() methods to declare throwing Throwable (rather than Exception) - error handling to now include errors thrown by convertToString() (previously just convertToType()) - error handling to handle Throwable (was Exception) - error handling to initialize the cause for JDK 1.4+ - change Log instance to transient and change all logging methods to use the log() method - modify Converters affected by AbstractConverter API change Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/AbstractConverter.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/ArrayConverter.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/BooleanConverter.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/ClassConverter.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/FileConverter.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/NumberConverter.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/URLConverter.java Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/AbstractConverter.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/AbstractConverter.java?view=diffrev=540381r1=540380r2=540381 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/AbstractConverter.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/AbstractConverter.java Mon May 21 17:59:25 2007 @@ -18,6 +18,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.ConversionException; import org.apache.commons.beanutils.Converter; @@ -58,7 +59,7 @@ /** * Logging for this instance. */ -private Log log = LogFactory.getLog(getClass()); +private transient Log _log; /** * The default type this codeConverter/code handles. @@ -123,8 +124,8 @@ Class sourceType = value == null ? null : value.getClass(); Class targetType = primitive(type == null ? getDefaultType() : type); -if (log.isDebugEnabled()) { -log.debug(Converting +if (log().isDebugEnabled()) { +log().debug(Converting + (value == null ? : ' + toString(sourceType) + ') + value ' + value + ' to type ' + toString(targetType) + '); } @@ -132,31 +133,32 @@ // Missing Value if (value == null) { return handleMissing(targetType); +} -// Convert -- String -} else if (targetType.equals(String.class)) { -return convertToString(value); - -// No conversion necessary -} else if (targetType.equals(sourceType)) { -if (log.isDebugEnabled()) { -log.debug(No conversion required, value is already a -+ toString(targetType)); -} -return value; +try { +// Convert -- String +if (targetType.equals(String.class)) { +return convertToString(value); + +// No conversion necessary +} else if (targetType.equals(sourceType)) { +if (log().isDebugEnabled()) { +log().debug(No conversion required, value is already a ++ toString(targetType)); +} +return value; -// Convert -- Type -} else { -try { +// Convert -- Type +} else { Object result = convertToType(targetType, value); -if (log.isDebugEnabled()) { -log.debug(Converted to + toString(targetType) + +if (log().isDebugEnabled()) { +log().debug(Converted to + toString(targetType) + value ' + result + '); } return result; -} catch (Exception ex) { -return handleError(targetType, value, ex); } +} catch
svn commit: r540383 - /jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/StringConverter.java
Author: niallp Date: Mon May 21 18:01:07 2007 New Revision: 540383 URL: http://svn.apache.org/viewvc?view=revrev=540383 Log: BEANUTILS-258 - switch StringConverter to be based on the new AbstractConveter - provides only limmited advantage, but StringConverter didn't have the usual ConversionException and default logic - which it now has Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/StringConverter.java Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/StringConverter.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/StringConverter.java?view=diffrev=540383r1=540382r2=540383 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/StringConverter.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/StringConverter.java Mon May 21 18:01:07 2007 @@ -14,15 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.commons.beanutils.converters; - -import org.apache.commons.beanutils.ConversionException; import org.apache.commons.beanutils.Converter; - /** * Standard [EMAIL PROTECTED] Converter} implementation that converts an incoming * object into a codejava.lang.String/code object. @@ -48,31 +43,40 @@ * @version $Revision$ $Date$ * @since 1.3 */ +public final class StringConverter extends AbstractConverter { -public final class StringConverter implements Converter { +/** + * Construct a bjava.lang.String/b iConverter/i that throws + * a codeConversionException/code if an error occurs. + */ +public StringConverter() { +super(String.class); +} -// - Public Methods - +/** + * Construct a bjava.lang.String/b iConverter/i that returns + * a default value if an error occurs. + * + * @param defaultValue The default value to be returned + * if the value to be converted is missing or an error + * occurs converting the value. + */ +public StringConverter(Object defaultValue) { +super(String.class, defaultValue); +} /** * Convert the specified input object into an output object of the * specified type. * - * @param type Data type to which this value should be converted - * @param value The input value to be converted - * - * @exception ConversionException if conversion cannot be performed - * successfully + * @param type Data type to which this value should be converted. + * @param value The input value to be converted. + * @return The converted value. + * @throws Throwable if an error occurs converting to the specified type */ -public Object convert(Class type, Object value) { - -if (value == null) { -return ((String) null); -} else { -return (value.toString()); -} - +protected Object convertToType(Class type, Object value) throws Throwable { +return value.toString(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r540385 - in /jakarta/commons/proper/beanutils/trunk: src/java/org/apache/commons/beanutils/ xdocs/
Author: niallp Date: Mon May 21 18:03:37 2007 New Revision: 540385 URL: http://svn.apache.org/viewvc?view=revrev=540385 Log: BEANUTILS-258 - re-factor Converter registration in ConvertUtilsBean to make configuring the standard converters for defaults/throwing exceptions easier Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/RowSetDynaClass.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/WrapDynaClass.java jakarta/commons/proper/beanutils/trunk/xdocs/changes.xml Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java?view=diffrev=540385r1=540384r2=540385 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java Mon May 21 18:03:37 2007 @@ -24,9 +24,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.net.URL; -import java.sql.Date; -import java.sql.Time; -import java.sql.Timestamp; import java.util.Collection; import java.util.Map; import java.util.HashMap; @@ -35,6 +32,7 @@ import org.apache.commons.beanutils.converters.BigIntegerConverter; import org.apache.commons.beanutils.converters.BooleanConverter; import org.apache.commons.beanutils.converters.ByteConverter; +import org.apache.commons.beanutils.converters.CalendarConverter; import org.apache.commons.beanutils.converters.CharacterConverter; import org.apache.commons.beanutils.converters.ClassConverter; import org.apache.commons.beanutils.converters.DateConverter; @@ -130,6 +128,8 @@ public class ConvertUtilsBean { +private static final Integer ZERO = new Integer(0); + // --- Class Methods /** * Get singleton instance @@ -557,76 +557,217 @@ converters.clear(); -// Note: these two converters have no default values. This is -// not consistent with the other numeric converters, but cannot -// be fixed without breaking backwards compatibility. +registerPrimitives(false); +registerStandard(false, false); +registerOther(true); +registerArrays(false, 0); register(BigDecimal.class, new BigDecimalConverter()); register(BigInteger.class, new BigIntegerConverter()); -registerArrayConverter(BigDecimal[].class, new BigDecimalConverter()); -registerArrayConverter(BigInteger[].class, new BigIntegerConverter()); +} -register(Boolean.TYPE, new BooleanConverter(defaultBoolean)); -register(Boolean.class, new BooleanConverter(defaultBoolean)); -registerArrayConverter(boolean[].class, new BooleanConverter()); -registerArrayConverter(Boolean[].class, new BooleanConverter()); -register(Byte.TYPE, new ByteConverter(defaultByte)); -register(Byte.class, new ByteConverter(defaultByte)); -registerArrayConverter(byte[].class, new ByteConverter()); -registerArrayConverter(Byte[].class, new ByteConverter()); -register(Character.TYPE, - new CharacterConverter(defaultCharacter)); -register(Character.class, - new CharacterConverter(defaultCharacter)); -registerArrayConverter(char[].class, new CharacterConverter()); -registerArrayConverter(Character[].class, new CharacterConverter()); -register(Class.class, new ClassConverter()); -register(Double.TYPE, new DoubleConverter(defaultDouble)); -register(Double.class, new DoubleConverter(defaultDouble)); -registerArrayConverter(double[].class, new DoubleConverter()); -registerArrayConverter(Double[].class, new DoubleConverter()); -register(Float.TYPE, new FloatConverter(defaultFloat)); -register(Float.class, new FloatConverter(defaultFloat)); -registerArrayConverter(float[].class, new FloatConverter()); -registerArrayConverter(Float[].class, new FloatConverter()); -register(Integer.TYPE, new IntegerConverter(defaultInteger)); -register(Integer.class, new IntegerConverter(defaultInteger)); -registerArrayConverter(int[].class, new IntegerConverter()); -registerArrayConverter(Integer[].class, new IntegerConverter()); -register(Long.TYPE, new LongConverter(defaultLong)); -register(Long.class, new LongConverter(defaultLong)); -registerArrayConverter(long[].class, new LongConverter()); -
Re: svn commit: r540385 - in /jakarta/commons/proper/beanutils/trunk: src/java/org/apache/commons/beanutils/ xdocs/
Woops - didn't mean to commit changes to RowSetDynaClass or WrapDynaClass. The RowSetDynaClass changes relate to BEANUTILS-142 The WrapDynaClass changes relate to BEANUTILS-59 I was going to see if anyone commented before committing either of these. For now I'll leave them in rather than reverting. Niall On 5/22/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Author: niallp Date: Mon May 21 18:03:37 2007 New Revision: 540385 URL: http://svn.apache.org/viewvc?view=revrev=540385 Log: BEANUTILS-258 - re-factor Converter registration in ConvertUtilsBean to make configuring the standard converters for defaults/throwing exceptions easier Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/RowSetDynaClass.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/WrapDynaClass.java jakarta/commons/proper/beanutils/trunk/xdocs/changes.xml Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java?view=diffrev=540385r1=540384r2=540385 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java Mon May 21 18:03:37 2007 @@ -24,9 +24,6 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.net.URL; -import java.sql.Date; -import java.sql.Time; -import java.sql.Timestamp; import java.util.Collection; import java.util.Map; import java.util.HashMap; @@ -35,6 +32,7 @@ import org.apache.commons.beanutils.converters.BigIntegerConverter; import org.apache.commons.beanutils.converters.BooleanConverter; import org.apache.commons.beanutils.converters.ByteConverter; +import org.apache.commons.beanutils.converters.CalendarConverter; import org.apache.commons.beanutils.converters.CharacterConverter; import org.apache.commons.beanutils.converters.ClassConverter; import org.apache.commons.beanutils.converters.DateConverter; @@ -130,6 +128,8 @@ public class ConvertUtilsBean { +private static final Integer ZERO = new Integer(0); + // --- Class Methods /** * Get singleton instance @@ -557,76 +557,217 @@ converters.clear(); -// Note: these two converters have no default values. This is -// not consistent with the other numeric converters, but cannot -// be fixed without breaking backwards compatibility. +registerPrimitives(false); +registerStandard(false, false); +registerOther(true); +registerArrays(false, 0); register(BigDecimal.class, new BigDecimalConverter()); register(BigInteger.class, new BigIntegerConverter()); -registerArrayConverter(BigDecimal[].class, new BigDecimalConverter()); -registerArrayConverter(BigInteger[].class, new BigIntegerConverter()); +} -register(Boolean.TYPE, new BooleanConverter(defaultBoolean)); -register(Boolean.class, new BooleanConverter(defaultBoolean)); -registerArrayConverter(boolean[].class, new BooleanConverter()); -registerArrayConverter(Boolean[].class, new BooleanConverter()); -register(Byte.TYPE, new ByteConverter(defaultByte)); -register(Byte.class, new ByteConverter(defaultByte)); -registerArrayConverter(byte[].class, new ByteConverter()); -registerArrayConverter(Byte[].class, new ByteConverter()); -register(Character.TYPE, - new CharacterConverter(defaultCharacter)); -register(Character.class, - new CharacterConverter(defaultCharacter)); -registerArrayConverter(char[].class, new CharacterConverter()); -registerArrayConverter(Character[].class, new CharacterConverter()); -register(Class.class, new ClassConverter()); -register(Double.TYPE, new DoubleConverter(defaultDouble)); -register(Double.class, new DoubleConverter(defaultDouble)); -registerArrayConverter(double[].class, new DoubleConverter()); -registerArrayConverter(Double[].class, new DoubleConverter()); -register(Float.TYPE, new FloatConverter(defaultFloat)); -register(Float.class, new FloatConverter(defaultFloat)); -registerArrayConverter(float[].class, new FloatConverter()); -registerArrayConverter(Float[].class, new FloatConverter()); -register(Integer.TYPE, new IntegerConverter(defaultInteger)); -register(Integer.class, new IntegerConverter(defaultInteger)); -
[jira] Commented: (BEANUTILS-59) [beanutils] Memory leak on webapp undeploy in WrapDynaClass
[ https://issues.apache.org/jira/browse/BEANUTILS-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497657 ] Niall Pemberton commented on BEANUTILS-59: -- Accicentally comitted the patch as part of r540385 - I'll leave it in for now - can always be reverted later http://svn.apache.org/viewvc?view=revrevision=540385 [beanutils] Memory leak on webapp undeploy in WrapDynaClass --- Key: BEANUTILS-59 URL: https://issues.apache.org/jira/browse/BEANUTILS-59 Project: Commons BeanUtils Issue Type: Bug Components: DynaBean Affects Versions: 1.6 Environment: Operating System: All Platform: All Reporter: Simon Kitching Fix For: 1.8.0 Attachments: beanutils-59.patch Class WrapDynaClass has a HashMap dynaClasses containing a mapping from Class to WrapDynaClass. If this class were to be deployed via a shared webapp, then any reference in there to a class loaded via the webapp classloader will prevent the webapp classloader from being garbage-collected when the webapp is undeployed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Commented: (BEANUTILS-142) [beanutils] RowSetDynaClass fails to copy resulset to DynaBean with Oracle 10g JDBC driver
[ https://issues.apache.org/jira/browse/BEANUTILS-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497658 ] Niall Pemberton commented on BEANUTILS-142: --- Accicentally comitted the patch as part of r540385 - I'll leave it in for now - can always be reverted later http://svn.apache.org/viewvc?view=revrevision=540385 [beanutils] RowSetDynaClass fails to copy resulset to DynaBean with Oracle 10g JDBC driver -- Key: BEANUTILS-142 URL: https://issues.apache.org/jira/browse/BEANUTILS-142 Project: Commons BeanUtils Issue Type: Bug Components: DynaBean Environment: Operating System: Windows XP Platform: All Reporter: Li Zhang Fix For: 1.8.0 Attachments: Beanutils-142.patch Beginning in Oracle 9.2, DATE is mapped to Date and TIMESTAMP is mapped to Timestamp. However if you were relying on DATE values to contain time information, there is a problem. When using Oracle 10g JDBC driver, the ResultSetMetaData.getColumnClassName returns java.sql.Timestamp but ResultSet.getObject(name).getClass() returns java.sql.Date. Obviously these two do not match each other. When the RowSetDynaClass.copy function tries to set the value to BasicDynaBean, it throws exception. Need a workaround. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r540390 - in /jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath: ./ ri/ ri/axes/ xml/
Author: niallp Date: Mon May 21 18:51:37 2007 New Revision: 540390 URL: http://svn.apache.org/viewvc?view=revrev=540390 Log: Javadoc corrections Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ClassFunctions.java jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/Compiler.java jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/NamespaceResolver.java jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/AncestorContext.java jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/AttributeContext.java jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/xml/DocumentContainer.java Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ClassFunctions.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ClassFunctions.java?view=diffrev=540390r1=540389r2=540390 == --- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ClassFunctions.java (original) +++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ClassFunctions.java Mon May 21 18:51:37 2007 @@ -64,7 +64,7 @@ /** * Returns a set of one namespace - the one specified in the constructor. * - * @returns a singleton + * @return a singleton */ public Set getUsedNamespaces() { return Collections.singleton(namespace); Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java?view=diffrev=540390r1=540389r2=540390 == --- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java (original) +++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathContext.java Mon May 21 18:51:37 2007 @@ -830,7 +830,7 @@ * NamespaceContextPointer is the same as the Context Pointer, see * [EMAIL PROTECTED] #getContextPointer() getContextPointer()} * - * @param contextPointer The pointer to the context where prefixes used in + * @param namespaceContextPointer The pointer to the context where prefixes used in *XPath expressions should be resolved. */ public void setNamespaceContextPointer(Pointer namespaceContextPointer) { Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java?view=diffrev=540390r1=540389r2=540390 == --- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java (original) +++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java Mon May 21 18:51:37 2007 @@ -49,7 +49,7 @@ private Source source; /** - * @param URL is a URL for an XML file. Use getClass().getResource + * @param xmlURL is a URL for an XML file. Use getClass().getResource * (resourceName) to load XML from a resource file. */ public XMLDocumentContainer(URL xmlURL) { Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/Compiler.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/Compiler.java?view=diffrev=540390r1=540389r2=540390 == --- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/Compiler.java (original) +++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/Compiler.java Mon May 21 18:51:37 2007 @@ -220,7 +220,7 @@ * * @param qname is a QNAME object */ -Object variableReference(Object qName); +Object variableReference(Object qname); /** * Produces an EXPRESSION object representing the computation of @@ -273,7 +273,7 @@ /** * Produces a NODE_TEST object that represents a node type test. * - * @param qname is a QNAME object + * @param nodeType is a NODE_TEST object */ Object nodeTypeTest(int nodeType); @@ -281,7 +281,7 @@ * Produces a NODE_TEST object that represents a processing instruction * test. * - * @param qname is a QNAME object + *
svn commit: r540391 - in /jakarta/commons/proper/jxpath/trunk: NOTICE.txt src/java/org/apache/commons/jxpath/util/ReverseComparator.java
Author: niallp Date: Mon May 21 18:52:14 2007 New Revision: 540391 URL: http://svn.apache.org/viewvc?view=revrev=540391 Log: Fix copyright date and add missing license header Modified: jakarta/commons/proper/jxpath/trunk/NOTICE.txt jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ReverseComparator.java Modified: jakarta/commons/proper/jxpath/trunk/NOTICE.txt URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/NOTICE.txt?view=diffrev=540391r1=540390r2=540391 == --- jakarta/commons/proper/jxpath/trunk/NOTICE.txt (original) +++ jakarta/commons/proper/jxpath/trunk/NOTICE.txt Mon May 21 18:52:14 2007 @@ -1,5 +1,5 @@ Apache Jakarta Commons JXPath -Copyright 1999-2004 The Apache Software Foundation +Copyright 1999-2007 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). Modified: jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ReverseComparator.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ReverseComparator.java?view=diffrev=540391r1=540390r2=540391 == --- jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ReverseComparator.java (original) +++ jakarta/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/ReverseComparator.java Mon May 21 18:52:14 2007 @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.commons.jxpath.util; import java.util.Comparator; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jxpath] release plan
On 5/21/07, Matt Benson [EMAIL PROTECTED] wrote: AFAIK JXPath JIRA is in fine shape. Only two open enhancement requests, both of which have been deemed to be major-version caliber changes. As a newcomer to Jakarta and a maven novice, I am now seeking input from the community on the process of building an RC and following through for a release of Commons JXPath 1.3 . I just ran maven dist and checed out the JXPath build - looks in reasonable shape, I fixed up a few JavaDoc warnings, corrected the copyright date in the NOTICE file and added a missing source file header that RAT highlighted. The only thing I couldn't see were release notes for 1.3. If you do those then IMO you're ready to cut a release candidate - IF you're happy to release using maven1. If thats the case then theres reasonably good notes on the Commons Site: http://jakarta.apache.org/commons/releases/index.html However most people do a slight variation on these. If however you want to do a release using maven2, then first you need an m2 pom (I can help with that) - then probably need to wait to see the issues resolved with (and release of) the commons parent pom. Hopefully the m2 gurus will sort it out soon. Anyway happy to help if you want. Niall TIA, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r540401 - in /jakarta/commons/proper/jxpath/trunk: maven.xml xdocs/navigation.xml
Author: niallp Date: Mon May 21 19:38:17 2007 New Revision: 540401 URL: http://svn.apache.org/viewvc?view=revrev=540401 Log: Change the build to generate and create checksums for javadoc and sources jars and add dependencies and license to navigation Modified: jakarta/commons/proper/jxpath/trunk/maven.xml jakarta/commons/proper/jxpath/trunk/xdocs/navigation.xml Modified: jakarta/commons/proper/jxpath/trunk/maven.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/maven.xml?view=diffrev=540401r1=540400r2=540401 == --- jakarta/commons/proper/jxpath/trunk/maven.xml (original) +++ jakarta/commons/proper/jxpath/trunk/maven.xml Mon May 21 19:38:17 2007 @@ -23,6 +23,20 @@ !-- == -- postGoal name=dist:prepare-bin-filesystem +!-- Create a jar file containing the sources -- +jar destfile=${maven.build.dir}/${maven.final.name}-sources.jar + zipfileset prefix=META-INF dir=${basedir} +includes=LICENSE*, NOTICE*/ + fileset dir=${basedir}/src/java includes=**/*.java/ +/jar + +!-- Create a jar file containing the Javadocs -- +jar destfile=${maven.build.dir}/${maven.final.name}-javadoc.jar + zipfileset prefix=META-INF dir=${basedir} +includes=LICENSE*, NOTICE*/ + fileset dir=${basedir}/target/docs/apidocs/ +/jar + copy todir=${maven.dist.bin.assembly.dir} fileset file='${basedir}/NOTICE.txt'/ !-- fileset file=${basedir}/RELEASE-NOTES.txt/ -- @@ -64,10 +78,26 @@ ant:echo message=${pom.md5} *${maven.final.name}.pom file=${maven.dist.dir}/${maven.final.name}.pom.md5 / + copy todir=${maven.dist.dir} + fileset file='${maven.build.dir}/${maven.final.name}.jar'/ + fileset file='${maven.build.dir}/${maven.final.name}-sources.jar'/ + fileset file='${maven.build.dir}/${maven.final.name}-javadoc.jar'/ + /copy + !-- create checksum for jar -- - ant:checksum file=${maven.build.dir}/${maven.final.name}.jar property=jar.md5/ + ant:checksum file=${maven.dist.dir}/${maven.final.name}.jar property=jar.md5/ ant:echo message=${jar.md5} *${maven.final.name}.jar - file=${maven.build.dir}/${maven.final.name}.jar.md5 / + file=${maven.dist.dir}/${maven.final.name}.jar.md5 / + + !-- create checksum for sources jar -- + ant:checksum file=${maven.dist.dir}/${maven.final.name}-sources.jar property=jar.md5/ + ant:echo message=${jar.md5} *${maven.final.name}-sources.jar + file=${maven.dist.dir}/${maven.final.name}-sources.jar.md5 / + + !-- create checksum for javadoc jar -- + ant:checksum file=${maven.dist.dir}/${maven.final.name}-javadoc.jar property=jar.md5/ + ant:echo message=${jar.md5} *${maven.final.name}-javadoc.jar + file=${maven.dist.dir}/${maven.final.name}-javadoc.jar.md5 / !-- create checksum for binary zip -- ant:checksum file=${maven.dist.dir}/${maven.final.name}.zip property=zip.md5/ Modified: jakarta/commons/proper/jxpath/trunk/xdocs/navigation.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/xdocs/navigation.xml?view=diffrev=540401r1=540400r2=540401 == --- jakarta/commons/proper/jxpath/trunk/xdocs/navigation.xml (original) +++ jakarta/commons/proper/jxpath/trunk/xdocs/navigation.xml Mon May 21 19:38:17 2007 @@ -33,6 +33,8 @@ item name=User's Guide href=/users-guide.html/ item name=JavaDoc href=/apidocs/index.html/ item name=Release Notes href=/release-notes-1.2.html/ + item name=Dependencieshref=/dependencies.html/ + item name=License href=/license.html/ item name=Wiki href=http://wiki.apache.org/jakarta-commons/JXPath/ /menu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Created: (JXPATH-85) Restore binary compatibility with JXPath 1.2
Restore binary compatibility with JXPath 1.2 Key: JXPATH-85 URL: https://issues.apache.org/jira/browse/JXPATH-85 Project: Commons JXPath Issue Type: Bug Affects Versions: 1.2 Final Reporter: Niall Pemberton Fix For: 1.3 I ran a CLIRR report comparing JXPath 1.2 with the current trunk and it higlighted one issue between the versions: ERROR: 7004: org.apache.commons.jxpath.ri.NamespaceResolver: In method 'public NamespaceResolver()' the number of arguments has changed Looking at the source NamespaceResolver no longer has a no-parameter constructor - adding this back in would make the upcoming JXPath 1.3 version binary compatible with JXPath 1.2. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jxpath] release plan
On 5/22/07, Niall Pemberton [EMAIL PROTECTED] wrote: On 5/21/07, Matt Benson [EMAIL PROTECTED] wrote: AFAIK JXPath JIRA is in fine shape. Only two open enhancement requests, both of which have been deemed to be major-version caliber changes. As a newcomer to Jakarta and a maven novice, I am now seeking input from the community on the process of building an RC and following through for a release of Commons JXPath 1.3 . I just ran maven dist and checed out the JXPath build - looks in reasonable shape, I fixed up a few JavaDoc warnings, corrected the copyright date in the NOTICE file and added a missing source file header that RAT highlighted. The only thing I couldn't see were release notes for 1.3. If you do those then IMO you're ready to cut a release candidate - IF you're happy to release using maven1. If thats the case then theres reasonably good notes on the Commons Site: http://jakarta.apache.org/commons/releases/index.html However most people do a slight variation on these. If however you want to do a release using maven2, then first you need an m2 pom (I can help with that) - then probably need to wait to see the issues resolved with (and release of) the commons parent pom. Hopefully the m2 gurus will sort it out soon. Couple more points... Looking at JXPath project.xml - I think you need to review the dependencies and mark any that need it as test, optional or provided - this will help your users alot with maven's dependency management. Validator has examples of this for both m1 and m2. Also your BeanUtils and Collections versions are very old - should they be upgraded? I also ran a CLIRR report to check binary compatibility - which highlighted one issue with binary compatibility with JXPath 1.2: https://issues.apache.org/jira/browse/JXPATH-85 Niall Anyway happy to help if you want. Niall TIA, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (JXPATH-85) Restore binary compatibility with JXPath 1.2
[ https://issues.apache.org/jira/browse/JXPATH-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated JXPATH-85: -- Attachment: jxpath-85.patch Patch to add bag in no-arg constructor Restore binary compatibility with JXPath 1.2 Key: JXPATH-85 URL: https://issues.apache.org/jira/browse/JXPATH-85 Project: Commons JXPath Issue Type: Bug Affects Versions: 1.2 Final Reporter: Niall Pemberton Fix For: 1.3 Attachments: jxpath-85.patch I ran a CLIRR report comparing JXPath 1.2 with the current trunk and it higlighted one issue between the versions: ERROR: 7004: org.apache.commons.jxpath.ri.NamespaceResolver: In method 'public NamespaceResolver()' the number of arguments has changed Looking at the source NamespaceResolver no longer has a no-parameter constructor - adding this back in would make the upcoming JXPath 1.3 version binary compatible with JXPath 1.2. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r540419 - in /jakarta/commons/proper/beanutils/trunk: build.xml src/java/org/apache/commons/beanutils/DynaBeanMapDecorator.java src/test/org/apache/commons/beanutils/DynaBeanMapDecoratorTe
Author: niallp Date: Mon May 21 21:52:13 2007 New Revision: 540419 URL: http://svn.apache.org/viewvc?view=revrev=540419 Log: BEANUTILS-185 Provide a Map decorator for a DynaBean (enables DynaBean to be used with other teechnologies such as JSTL) Added: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/DynaBeanMapDecorator.java (with props) jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/DynaBeanMapDecoratorTestCase.java (with props) Modified: jakarta/commons/proper/beanutils/trunk/build.xml Modified: jakarta/commons/proper/beanutils/trunk/build.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/build.xml?view=diffrev=540419r1=540418r2=540419 == --- jakarta/commons/proper/beanutils/trunk/build.xml (original) +++ jakarta/commons/proper/beanutils/trunk/build.xml Mon May 21 21:52:13 2007 @@ -271,6 +271,7 @@ test.lazy.dynabean, test.lazy.dynamap, test.lazy.dynalist, +test.dynabean.mapdecorator, test.indexed.properties, test.mapped.properties @@ -500,6 +501,21 @@ sysproperty key=org.apache.commons.logging.simplelog.defaultlog value=${test.level}/ arg value=org.apache.commons.beanutils.LazyDynaListTestCase/ + classpath refid=test.classpath/ +/java + /target + + target name=test.dynabean.mapdecorator depends=compile.tests +echo message=Running DynaBeanMapDecorator tests .../ +java classname=${test.runner} fork=yes +failonerror=${test.failonerror} + sysproperty key=org.apache.commons.logging.LogFactory + value=${test.factory}/ + sysproperty key=org.apache.commons.logging.Log + value=${test.log}/ + sysproperty key=org.apache.commons.logging.simplelog.defaultlog + value=${test.level}/ + arg value=org.apache.commons.beanutils.DynaBeanMapDecoratorTestCase/ classpath refid=test.classpath/ /java /target Added: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/DynaBeanMapDecorator.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/DynaBeanMapDecorator.java?view=autorev=540419 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/DynaBeanMapDecorator.java (added) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/DynaBeanMapDecorator.java Mon May 21 21:52:13 2007 @@ -0,0 +1,394 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.beanutils; + +import java.util.Map; +import java.util.List; +import java.util.ArrayList; +import java.util.Set; +import java.util.LinkedHashSet; +import java.util.Iterator; +import java.util.Collection; +import java.util.Collections; + +/** + * pDecorates a [EMAIL PROTECTED] DynaBean} to provide codeMap/code behaviour./p + * + * pThe motivation for this implementation is to provide access to [EMAIL PROTECTED] DynaBean} + *properties in technologies that are unaware of BeanUtils and [EMAIL PROTECTED] DynaBean}s - + *such as the expression languages of JSTL and JSF./p + * + * pThis can be achieved either by wrapping the [EMAIL PROTECTED] DynaBean} prior to + *providing it to the technolody to process or by providing a codeMap/code + *accessor method on the DynaBean implementation: + *precode + * public Map getMap() { + * return new DynaBeanMapDecorator(this); + * }/code/pre + * /ul + * /p + * + * pThis, for example, could be used in JSTL in the following way to access + *a DynaBean's codefooProperty/code: + *ullicode${myDynaBean.bmap/b.fooProperty}/code/li/ul + * /p + * + * h3Usage/h3 + * + * pTo decorate a [EMAIL PROTECTED] DynaBean} simply instantiate this class with the + *
svn commit: r540421 - /jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/DynaBeanMapDecoratorTestCase.java
Author: niallp Date: Mon May 21 21:58:00 2007 New Revision: 540421 URL: http://svn.apache.org/viewvc?view=revrev=540421 Log: fix license header Modified: jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/DynaBeanMapDecoratorTestCase.java Modified: jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/DynaBeanMapDecoratorTestCase.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/DynaBeanMapDecoratorTestCase.java?view=diffrev=540421r1=540420r2=540421 == --- jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/DynaBeanMapDecoratorTestCase.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/DynaBeanMapDecoratorTestCase.java Mon May 21 21:58:00 2007 @@ -1,9 +1,10 @@ /* - * Copyright 2006 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -12,7 +13,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ + */ package org.apache.commons.beanutils; import java.util.ArrayList; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r540426 - in /jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils: BasicDynaBean.java DynaBeanMapDecorator.java LazyDynaBean.java LazyDynaMap.java
Author: niallp Date: Mon May 21 22:34:47 2007 New Revision: 540426 URL: http://svn.apache.org/viewvc?view=revrev=540426 Log: Provide a getMap() method in DynaBeanMapDecorator in BasicDynaBean that uses DynaBeanMapDecorator to provide a Map representation of the DynaBean Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BasicDynaBean.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/DynaBeanMapDecorator.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/LazyDynaBean.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/LazyDynaMap.java Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BasicDynaBean.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BasicDynaBean.java?view=diffrev=540426r1=540425r2=540426 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BasicDynaBean.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/BasicDynaBean.java Mon May 21 22:34:47 2007 @@ -76,6 +76,27 @@ */ protected HashMap values = new HashMap(); +/** Map decorator for this DynaBean */ +private transient Map mapDecorator; + +/** + * Return a Map representation of this DynaBean. + * /p + * This, for example, could be used in JSTL in the following way to access + * a DynaBean's codefooProperty/code: + * ullicode${myDynaBean.bmap/b.fooProperty}/code/li/ul + * + * @return a Map representation of this DynaBean + */ +public Map getMap() { + +// cache the Map +if (mapDecorator == null) { +mapDecorator = new DynaBeanMapDecorator(this); +} +return mapDecorator; + +} // -- DynaBean Methods Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/DynaBeanMapDecorator.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/DynaBeanMapDecorator.java?view=diffrev=540426r1=540425r2=540426 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/DynaBeanMapDecorator.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/DynaBeanMapDecorator.java Mon May 21 22:34:47 2007 @@ -74,7 +74,7 @@ private DynaBean dynaBean; private boolean readOnly; -private Set keySet; +private transient Set keySet; // --- Constructors -- @@ -331,7 +331,7 @@ * * @return the decorated [EMAIL PROTECTED] DynaBean}. */ -protected DynaBean getDynaBean() { +public DynaBean getDynaBean() { return dynaBean; } Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/LazyDynaBean.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/LazyDynaBean.java?view=diffrev=540426r1=540425r2=540426 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/LazyDynaBean.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/LazyDynaBean.java Mon May 21 22:34:47 2007 @@ -140,6 +140,9 @@ */ protected Map values; +/** Map decorator for this DynaBean */ +private transient Map mapDecorator; + /** * The codeMutableDynaClass/code base class that this DynaBean * is associated with. @@ -188,11 +191,20 @@ // --- Public Methods -- /** - * Return the Map backing this codeDynaBean/code - * @return the underlying Map + * Return a Map representation of this DynaBean. + * /p + * This, for example, could be used in JSTL in the following way to access + * a DynaBean's codefooProperty/code: + * ullicode${myDynaBean.bmap/b.fooProperty}/code/li/ul + * + * @return a Map representation of this DynaBean */ public Map getMap() { -return values; +// cache the Map +if (mapDecorator == null) { +mapDecorator = new DynaBeanMapDecorator(this); +} +return mapDecorator; } /** Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/LazyDynaMap.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/LazyDynaMap.java?view=diffrev=540426r1=540425r2=540426
[jira] Updated: (BEANUTILS-185) Try to align BeanUtils with JSTL standard tags
[ https://issues.apache.org/jira/browse/BEANUTILS-185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-185: -- Affects Version/s: 1.7.0 Fix Version/s: (was: LATER THAN 1.8.0) 1.8.0 Assignee: Niall Pemberton Summary: Try to align BeanUtils with JSTL standard tags (was: [beanutils] Try to align BeanUtils with JSTL standard tags) I have added the DynaBeanMapDecorator to BeanUtils Try to align BeanUtils with JSTL standard tags -- Key: BEANUTILS-185 URL: https://issues.apache.org/jira/browse/BEANUTILS-185 Project: Commons BeanUtils Issue Type: Improvement Components: DynaBean Affects Versions: 1.7.0 Environment: Operating System: other Platform: Other Reporter: Gabriel Belingueres Assigned To: Niall Pemberton Priority: Minor Fix For: 1.8.0 Attachments: AbstractRowSetDynaClass.java, BasicDirectAccessDynaBean.java, BasicDirectAccessDynaBeanTestCase.java, BasicIndirectAccessDynaBean.java, beanutil-diff.txt, DirectAccessDynaBean.java, DirectRowSetDynaClass.java, DynaBeanMapDecorator.java, DynaBeanMapDecoratorTestCase.java, IndirectAccessDynaBean.java, IndirectRowSetDynaClass.java Hi, I've done some modifications to the beanutils package to better support the use of DynaBeans with the JSTL tags. Some of the changes are discussed in this thread of the commons-user mailing list: http://marc.theaimsgroup.com/?l=jakarta-commons-userm=114669123403779w=2 I attach the diff file that comprises changes to the RowSetDynaClass.java file and build.xml file (since I added a TestCase.) Note: Please try to filter carefully the diffs in the build.xml file since they include some local settings I have for compilation on my machine. :-( Together with the diff file, I attach the new java files added to the package. Regards, Gabriel Belingueres [EMAIL PROTECTED] -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-280) Check binary compatibility is still good
[ https://issues.apache.org/jira/browse/BEANUTILS-280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Niall Pemberton updated BEANUTILS-280: -- Attachment: CLIRR.txt clirr report attached - need to ensure optional/bean-collections classes are included in the main jar Check binary compatibility is still good Key: BEANUTILS-280 URL: https://issues.apache.org/jira/browse/BEANUTILS-280 Project: Commons BeanUtils Issue Type: Task Reporter: Henri Yandell Fix For: 1.8.0 Attachments: CLIRR.txt Clirr/jardiff/whatever. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]