svn commit: r471432 - in /jakarta/commons/proper/betwixt/trunk: project.xml src/java/org/apache/commons/betwixt/XMLUtils.java xdocs/faq.xml xdocs/guide/binding.xml xdocs/guide/examples.xml xdocs/guide
Author: dennisl Date: Sun Nov 5 06:13:17 2006 New Revision: 471432 URL: http://svn.apache.org/viewvc?view=revrev=471432 Log: Fix broken links. Modified: jakarta/commons/proper/betwixt/trunk/project.xml jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/XMLUtils.java jakarta/commons/proper/betwixt/trunk/xdocs/faq.xml jakarta/commons/proper/betwixt/trunk/xdocs/guide/binding.xml jakarta/commons/proper/betwixt/trunk/xdocs/guide/examples.xml jakarta/commons/proper/betwixt/trunk/xdocs/guide/start.xml jakarta/commons/proper/betwixt/trunk/xdocs/guide/writing.xml jakarta/commons/proper/betwixt/trunk/xdocs/powered.xml Modified: jakarta/commons/proper/betwixt/trunk/project.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/betwixt/trunk/project.xml?view=diffrev=471432r1=471431r2=471432 == --- jakarta/commons/proper/betwixt/trunk/project.xml (original) +++ jakarta/commons/proper/betwixt/trunk/project.xml Sun Nov 5 06:13:17 2006 @@ -192,7 +192,7 @@ groupIdxerces/groupId artifactIdxerces/artifactId version2.4.0/version - urlhttp://xml.apache.org/xerces2-j/index.html/url + urlhttp://xerces.apache.org/xerces2-j/index.html/url properties commentAny JAXP compliant parser (1.2 or later)./comment /properties Modified: jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/XMLUtils.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/XMLUtils.java?view=diffrev=471432r1=471431r2=471432 == --- jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/XMLUtils.java (original) +++ jakarta/commons/proper/betwixt/trunk/src/java/org/apache/commons/betwixt/XMLUtils.java Sun Nov 5 06:13:17 2006 @@ -20,7 +20,7 @@ * * pThe code for [EMAIL PROTECTED] #isWellFormedXMLName} is based on code in * codeorg.apache.xerces.util.XMLChar/code - * in a href='http://xml.apache.org/xerces2-j/index.html'Apache Xerces/a. + * in a href='http://xerces.apache.org/xerces2-j/index.html'Apache Xerces/a. * The authors of this class are credited below./p * * @author Glenn Marcy, IBM @@ -380,7 +380,7 @@ * * pThe code for this method is based on code in * codeorg.apache.xerces.util.XMLChar/code - * in a href='http://xml.apache.org/xerces2-j/index.html'Apache Xerces/a. + * in a href='http://xerces.apache.org/xerces2-j/index.html'Apache Xerces/a. * The authors of this class are credited at the top of this class./p * * @param name the codeString/code to be checked for use as an xml attribute Modified: jakarta/commons/proper/betwixt/trunk/xdocs/faq.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/betwixt/trunk/xdocs/faq.xml?view=diffrev=471432r1=471431r2=471432 == --- jakarta/commons/proper/betwixt/trunk/xdocs/faq.xml (original) +++ jakarta/commons/proper/betwixt/trunk/xdocs/faq.xml Sun Nov 5 06:13:17 2006 @@ -342,7 +342,7 @@ dd Betwixt uses Maven for its build system. So you should be able to build Betwixt just like any other Maven enabled project. Please see the - a href=http://maven.apache.org/start/index.html;Maven/a + a href=http://maven.apache.org/maven-1.x/;Maven/a documentation for details. /dd /dl Modified: jakarta/commons/proper/betwixt/trunk/xdocs/guide/binding.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/betwixt/trunk/xdocs/guide/binding.xml?view=diffrev=471432r1=471431r2=471432 == --- jakarta/commons/proper/betwixt/trunk/xdocs/guide/binding.xml (original) +++ jakarta/commons/proper/betwixt/trunk/xdocs/guide/binding.xml Sun Nov 5 06:13:17 2006 @@ -658,7 +658,7 @@ Advanced users will probably need a particular date format. The recommended way to do this is through registering appropriate converters with ConvertUtils. The default conversion strategy must also be replaced with an instance of -a href='../apidocs/org/apache.commons/betwixt/strategy/ConvertUtilsObjectStringConverter.html' +a href='../apidocs/org/apache/commons/betwixt/strategy/ConvertUtilsObjectStringConverter.html' ConvertUtilsObjectStringConverter/a. This is set though a codeBindingConfiguration/code property. /p p @@ -687,7 +687,7 @@ /p p The strategy class -a href='../apidocs/org/apache.commons/betwixt/strategy/ObjectStringConverter.html'ObjectStringConverter/a +a href='../apidocs/org/apache/commons/betwixt/strategy/ObjectStringConverter.html'ObjectStringConverter/a is simple: containing only two simple methods. For more
Re: [betwixt] please check RC1
robert burrell donkin wrote: http://people.apache.org/~rdonkin/commons-betwixt - robert I ran a linkcheck on the Maven generated site and it found a couple of broken links that I have fixed. When compiling using Maven 1.0.2 and JDK 1.4.2_12 I get 12 deprecation warnings for the sources and 19 deprecation warnings for test sources. Maybe something to have a look at? -- Dennis Lundberg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [betwixt] please check RC1
On Sun, 2006-11-05 at 15:19 +0100, Dennis Lundberg wrote: robert burrell donkin wrote: http://people.apache.org/~rdonkin/commons-betwixt - robert I ran a linkcheck on the Maven generated site and it found a couple of broken links that I have fixed. thanks :-) When compiling using Maven 1.0.2 and JDK 1.4.2_12 I get 12 deprecation warnings for the sources and 19 deprecation warnings for test sources. Maybe something to have a look at? yeh nearly all are in deprecated methods or classes or test deprecated methods or classes. this other one is safe enough (overrides a deprecated method) and it's probably not worth risking making a change. - robert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r471498 - in /jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections: Closure.java Factory.java Predicate.java Transformer.java
Author: scolebourne Date: Sun Nov 5 11:24:09 2006 New Revision: 471498 URL: http://svn.apache.org/viewvc?view=revrev=471498 Log: Generify Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Closure.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Factory.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Predicate.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Transformer.java Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Closure.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Closure.java?view=diffrev=471498r1=471497r2=471498 == --- jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Closure.java (original) +++ jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Closure.java Sun Nov 5 11:24:09 2006 @@ -24,7 +24,8 @@ * p * Standard implementations of common closures are provided by * [EMAIL PROTECTED] ClosureUtils}. These include method invokation and for/while loops. - * + * + * @param T the type that the closure acts on * @since Commons Collections 1.0 * @version $Revision$ $Date$ * @@ -32,7 +33,7 @@ * @author Nicola Ken Barozzi * @author Stephen Colebourne */ -public interface Closure { +public interface ClosureT { /** * Performs an action on the specified input object. @@ -42,6 +43,6 @@ * @throws IllegalArgumentException (runtime) if the input is invalid * @throws FunctorException (runtime) if any other error occurs */ -public void execute(Object input); +public void execute(T input); } Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Factory.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Factory.java?view=diffrev=471498r1=471497r2=471498 == --- jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Factory.java (original) +++ jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Factory.java Sun Nov 5 11:24:09 2006 @@ -26,13 +26,14 @@ * [EMAIL PROTECTED] FactoryUtils}. These include factories that return a constant, * a copy of a prototype or a new instance. * + * @param T the type that the factory creates * @since Commons Collections 2.1 * @version $Revision$ $Date$ * * @author Arron Bates * @author Stephen Colebourne */ -public interface Factory { +public interface FactoryT { /** * Create a new object. @@ -40,6 +41,6 @@ * @return a new object * @throws FunctorException (runtime) if the factory cannot create an object */ -public Object create(); +public T create(); } Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Predicate.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Predicate.java?view=diffrev=471498r1=471497r2=471498 == --- jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Predicate.java (original) +++ jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/Predicate.java Sun Nov 5 11:24:09 2006 @@ -28,13 +28,14 @@ * [EMAIL PROTECTED] PredicateUtils}. These include true, false, instanceof, equals, and, * or, not, method invokation and null testing. * + * @param T the type that the predicate queries * @since Commons Collections 1.0 * @version $Revision$ $Date$ * * @author James Strachan * @author Stephen Colebourne */ -public interface Predicate { +public interface PredicateT { /** * Use the specified parameter to perform a test that returns true or false. @@ -45,6 +46,6 @@ * @throws IllegalArgumentException (runtime) if the input is invalid * @throws FunctorException (runtime) if the predicate encounters a problem */ -public boolean evaluate(Object object); +public boolean evaluate(T object); } Modified:
Re: [pool][dbcp] trimming the pool size after load spikes
Sandy, Sorry I missed this, which is unfortunate since I have been banging my head on DBCP-65 for several hours over the last week. See comments inline below. On 10/31/06, Sandy McArthur [EMAIL PROTECTED] wrote: Phil and others interested in Pool and DBCP, While working on resolving POOL-86 which is about finding a way to trim the pool size down after a load spike to try to minimize used resources during off peak load levels. This is a reasonable requirement, IMO. Sometimes this happens after dependent resource slowdowns as well as load spikes. I've suggested a decorator that wraps a pool and monitors it's usage and intercepts calls to returnObject and directs them to invalidateObject occasionally in order to shrink the size of the idle objects in the pool. I think this is a good idea because it solves the deadlock issue described in DBCP-65 when DBCP uses an evictor. Can you explain exactly how this will solve DBCP-65? The most crude form of the decorator would implement returnObject something like: returnObject(Object obj) { if (Math.random() 0.01) { // 1% of the time wrappedPool.invalidateObject(obj); } else { wrappedPool.returnObject(obj); } } more intelligent code could take in to account the actual number if active and idle pooled objects. Hopefully that conveys the idea I'm thinking of. I like this idea, with the latter kind of implementation. It is interesting to think about the performance implications of the crude form under differing load profiles. It could hurt in some cases. Some sort of rolling mean of idle connections or longest idle time would probably be best to use (i.e., not just current data, but some measure of how much headroom the pool has had recently). This does have flaws in that it does require activity on the pool for it to work because it wouldn't have it's own thread, but that is also how it avoids the risk of deadlocks. Is there any really threadsafe way to do it otherwise? Unfortunately, the activity requirement is bad because the time when you want the benefit is precisely when it will be slow coming. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [collections] Generics the collection subpackage
If only I had more than +1 vote! Stephen Colebourne wrote: There has been reltively little feedback on these backwards incompatible changes. Do I assume (by lazy consensus) that [collections-generics] will be seriously backwards incompatible? Can I commit changes? Are we agreed on the strategy produce the best API, rather than produce a compatible API. Stephen Stephen Colebourne wrote: First analysis of the collection subpackage of [collections] for the generics branch. - BoundedCollection should be deleted/renamed to Bounded new Bounded interface would not implement Collection, allowing it to be implemented by Maps as well as Collections - UnmodifiableBoundedCollection should be deleted Just use the isFull/maxSize methods on CollectionUtils or similar - AbstractSerializedCollectionDecorator should be deleted Serialization can now be rolled up into the base decorator This simplifies a lot of code It wasn't done originally due to back-compat - TransformedCollection will need some thinking about to generify, as a transformer can change object types - Consider adding a Decorator interface This would provide a single method decorated() that obtains the collection that has been decorated. Whilst useful, this is also potentially dangerous exposure of state. - Consider adding a Container interface This would be a base super interface for Collection and Map (but obviously we can't hack the JDK. - Consider whether UnmodifiableCollection should be deleted as it duplicates the JDK. Stephen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Commented: (CODEC-52) Digest on InputStreams
[ http://issues.apache.org/jira/browse/CODEC-52?page=comments#action_12447320 ] Niklas Gustavsson commented on CODEC-52: Certainly not from my part :-) Digest on InputStreams -- Key: CODEC-52 URL: http://issues.apache.org/jira/browse/CODEC-52 Project: Commons Codec Issue Type: Improvement Reporter: Niklas Gustavsson Attachments: CODEC-52-patch.diff When calculating digests on large amount of data (for example large files) the current methods that takes a byte array or String in not sufficient. MessageDigest supports getting a digest for a stream. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Created: (COLLECTIONS-233) Closure is an inaccurate name
Closure is an inaccurate name - Key: COLLECTIONS-233 URL: http://issues.apache.org/jira/browse/COLLECTIONS-233 Project: Commons Collections Issue Type: Improvement Components: Collection Affects Versions: Generics Reporter: Stephen Kestle The Closure in commons collections is not named well: for non-functional programmers it will induce a what's that?, and for functional programmers it will confuse expectations. From http://en.wikipedia.org/wiki/Closure_(computer_science): A closure combines the code of a function with a special lexical environment bound to that function (scope). Java cannot pass functions, so the only way this can be done is with an (inner) class, as follows (also from wikipedia): class CalculationWindow extends JFrame { private JButton btnSave; ... public final calculateInSeparateThread(final URI uri) { // The expression new Runnable() { ... } is an anonymous class. Runnable runner = new Runnable() { void run() { // It can access final local variables: calculate(uri); // It can access private fields of the enclosing class: btnSave.setEnabled(true); } }; new Thread(runner).start(); } } Note how the Runnable accesses the btnSave variable in the function scope. This special lexical environment is NOT the same as passing a parameter through a constructor OR execute method. A Closure should NOT take a parameter for execute. It is not actually possible to have a Closure object, as that breaks the lexical environment. So, what to do? I would propose an interface called Processor. It is more intuitive and has many real world examples that can anchor the term so that it makes sense to the average programmer. For example, when applying for a passport, some documentation needs to be filled out, and then it will go through a process to get you a passport. You hand (or send) your forms to a clerk (Processor), and that's it. The Processor does not reply - the context that is passed in your form (your details) allows a message to be sent back at a later date. For backwards compatibility the interface would be public interface ProcessorT extends ClosureT{} with the appropriate documentation. Closure would be deprecated with an appropriate explanation. However, it may be acceptable with the new version just to do a rename. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [collections] Generics the collection subpackage
Created https://issues.apache.org/jira/browse/COLLECTIONS-233 Stephen Kestle wrote: I shall be opening a ticket for the Closure one in the next while (when I get a chance). Note that Procedure and Function don't actually say anything - they're very broad programming principals. Also note that a Factory may not actually create/generate something (it may already be in the warehouse) - it's also a well known convention. Cheers Stephen I would propose Closure - Processor - Rename functor interfaces and update method signatures in collections to match those in [functor], specifically Closure -- Procedure, Transformer -- Function or Functor, Factory -- Generator - Add TertiaryXxx, QuaternaryXxx, and NaryXxx (using varargs, e.g. E xxx(E... e)) interfaces michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [collections-generics] [PROPOSAL] Remove all author and since version tags
On 11/4/06, Stephen Colebourne [EMAIL PROTECTED] wrote: As this is a 'new' project, I propose that we: - remove all @author tags - this complies with previous ASF board suggestions snip/ IMO new code should not contain author tags, gets tedious in many ways. You may want to stop accepting contributions that contain these (by requesting removal first). -Rahul - remove all @since tags - as its incompatible anyway, and will probably end up in a separate package, these have no real meaning Any dissenting opinions? First commits on this topic won't be until after 18th November 2006. Stephen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [all] Nightly builds
On 11/4/06, Henri Yandell [EMAIL PROTECTED] wrote: On 11/4/06, Henri Yandell [EMAIL PROTECTED] wrote: Just as an fyi - I'm running the nightly builds on a home machine to get a more recent snapshot out than the backups gave us. It's chugging away at the moment, so we'll see how it goes. beanutils - deployed 11:41am. validator - deployed 17:41am. vfs - building. Damn - 6 hours and still going. Sandbox still to go. It's giving the machine (a rather mundane 1Ghz P3) a definite workout. snip/ Well, its good to see recent snaps of most components available again. Thanks! -Rahul Hen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[net] FTPS client auth required
Hi I'm trying to create tests for client authentication for Apache FtpServer. For this I'm using commons-net as the client but is running into problems with the client auth support in FTPSClient. I'm setting setNeedClientAuth(true) but still get problems due to FTPSClient sending a null certificate chain. How should I set up my keystore so that FTPSClient finds it and can use it to send the correct certificate to the server for authentication? I've tried with the javax.net.ssl.keyStore system property but to no avail. Also, if I understand the current implementation of FTPSClient and FTPSTrustManager. From what I can understand, the implementation only checks if the service certificate is valid, not if it's trusted. Is this correct? If so, this would probably be a security issue in that a fake server serving up any valid certificate would be trusted by the client. Is this the intended behavior? /niklas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-258) Improve Converter Implementations
[ http://issues.apache.org/jira/browse/BEANUTILS-258?page=all ] Niall Pemberton updated BEANUTILS-258: -- Component/s: Converters Improve Converter Implementations - Key: BEANUTILS-258 URL: http://issues.apache.org/jira/browse/BEANUTILS-258 Project: Commons BeanUtils Issue Type: Improvement Components: Converters Affects Versions: 1.7.0 Reporter: Niall Pemberton Assigned To: Niall Pemberton Priority: Minor Fix For: 1.8.0 The Converter contract has the following signature public Object convert(Class, Object) ...which incudes the type (Class) that the value should be converted to. However all the Converter implementations in BeanUtils ignore this parameter and always convert to a specific type - for example IntegerConverter only ever converts to Integer values. One of the weaknesses in BeanUtils is that conversion of an Object to a String is almost always done using the toString() method which, depending on the Class, can produce unhelpful values. IMO all Converter implementations should, at a minimum, support also support conversion from the type they handle to a String. Theres two stages to this process: 1) Enhance Converter implementations to handle conversion to Strings. 2) Modify BeanUtils/PropertyUtils to delegate String conversion to the Converters. In order to facilitate this, I'm adding a new AbstractConverter class which removes the need for duplciated boiler plate code. As well as providing a structure for conversion it also handles missing and invalid values in a uniform way. I also have new NumberConverter and DateTimeConverter implementations which provide improved String conversion facilities: 1) Number Conversion The existing number Converter implementations use String handling functions provided by the Number implementation. This has two main drawbacks - they don't handle String values containing thousand separators and they are fixed using a period (.) as the decimal separator making them only usable in Locales where that is the case. I'm adding a number Converter where a pattern can be specified for the format and/or a Locale specified to use different decimal symbols. This caters for the alternative Locale scenario and isn't intended to provide support for applications operating in a multiple Locale environment. 2) Date/Time Conversion Currently there are only implementations for the java.sql.Date/Time/Timestamp types - java.util.Date and java.util.Calendar are not handled. I have a date/time Converter implementation that caters for all of these types. As people have indicated elsewhere converting from Strings to Date/Calendar poses problems. This implementation can be configured either to use the default format for a specified Locale or can be configured with a set of date patterns. This may not fully satisfy String -- Date conversion requirements, but will at least provide something and importantly will provide Date conversion factilities where String is not involved (e.g. Date -- Calendar). 3) Array Conversion I also have a generic array Converter implementation. It can convert to/from Arrays of any type. It does this by delegating the element conversion to a Converter of the appropriate type. As well as that it also caters for Collection -- Array conversion and provides addtiona configuraton options for parsing delimited String. I'm going to start committing the changes to the Converters initially. If no-one objects to those, then I'll start looking at improving how BeanUtils/PropertyUtils uses/delegates to Converters. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-257) Many of the helper methods expose the java.lang exceptions. I'd like to convert them to RuntimeExceptions
[ http://issues.apache.org/jira/browse/BEANUTILS-257?page=all ] Niall Pemberton updated BEANUTILS-257: -- Component/s: Utils (Bean, Property, Method) Many of the helper methods expose the java.lang exceptions. I'd like to convert them to RuntimeExceptions - Key: BEANUTILS-257 URL: http://issues.apache.org/jira/browse/BEANUTILS-257 Project: Commons BeanUtils Issue Type: Improvement Components: Utils (Bean, Property, Method) Affects Versions: 1.8.0 Reporter: Aaron Digulla Hello, A lot of the helper functions throw checked exceptions (mostly IllegalAccessException, InvocationTargetException and NoSuchMethodException). I'd like to write a patch which converts them all into RuntimeExceptions so the code upstream doesn't have to handle them. Rationale: When working with properties, you usually expect the code to work. When working with dynamic properties, you don't care about what went wrong but only that something went wrong. In most cases, it's not possible to fix the problem automatically but the code has to pass the exception up. This all calls for non-checked exceptions. My patch would be against the SVN version and contain these changes: - The old methods would still be there with an E at the end (for throws a checked exception). - The new code would throw exceptions based on a common exception so you can catch all the exceptions thrown in beanutils in one statement. IAE, ITE, etc. would then be derived from this base class so you can still filter them. Since this is going to involve some work, I wanted to ask beforehand if you would accept such a patch. Best regards. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r471575 - /jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/
Author: scolebourne Date: Sun Nov 5 15:58:08 2006 New Revision: 471575 URL: http://svn.apache.org/viewvc?view=revrev=471575 Log: Generify and remove AbstractSerializableCollectionDecorator Removed: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/AbstractSerializableCollectionDecorator.java Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/AbstractCollectionDecorator.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/PredicatedCollection.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/SynchronizedCollection.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/TransformedCollection.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/UnmodifiableBoundedCollection.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/UnmodifiableCollection.java Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/AbstractCollectionDecorator.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/AbstractCollectionDecorator.java?view=diffrev=471575r1=471574r2=471575 == --- jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/AbstractCollectionDecorator.java (original) +++ jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/AbstractCollectionDecorator.java Sun Nov 5 15:58:08 2006 @@ -16,6 +16,7 @@ */ package org.apache.commons.collections.collection; +import java.io.Serializable; import java.util.Collection; import java.util.Iterator; @@ -41,7 +42,11 @@ * @author Stephen Colebourne * @author Paul Jack */ -public abstract class AbstractCollectionDecoratorE implements CollectionE { +public abstract class AbstractCollectionDecoratorE +implements CollectionE, Serializable { + +/** Serialization version */ +private static final long serialVersionUID = 6249888059822088500L; /** The collection being decorated */ protected CollectionE collection; Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/PredicatedCollection.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/PredicatedCollection.java?view=diffrev=471575r1=471574r2=471575 == --- jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/PredicatedCollection.java (original) +++ jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/PredicatedCollection.java Sun Nov 5 15:58:08 2006 @@ -17,7 +17,6 @@ package org.apache.commons.collections.collection; import java.util.Collection; -import java.util.Iterator; import org.apache.commons.collections.Predicate; @@ -34,19 +33,20 @@ * p * This class is Serializable from Commons Collections 3.1. * + * @param E the type of the elements in the collection * @since Commons Collections 3.0 * @version $Revision$ $Date$ * * @author Stephen Colebourne * @author Paul Jack */ -public class PredicatedCollection extends AbstractSerializableCollectionDecorator { +public class PredicatedCollectionE extends AbstractCollectionDecoratorE { /** Serialization version */ private static final long serialVersionUID = -5259182142076705162L; /** The predicate to use */ -protected final Predicate predicate; +protected final Predicate? super E predicate; /** * Factory method to create a predicated (validating) collection. @@ -54,14 +54,15 @@ * If there are any elements already in the collection being decorated, they * are validated. * + * @param T the type of the elements in the collection * @param coll the collection to decorate, must not be null * @param predicate the predicate to use for validation, must not be null * @return a new predicated collection * @throws IllegalArgumentException if collection or predicate is null * @throws IllegalArgumentException if the collection contains
svn commit: r471578 - /jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/collection/
Author: scolebourne Date: Sun Nov 5 16:11:13 2006 New Revision: 471578 URL: http://svn.apache.org/viewvc?view=revrev=471578 Log: Generify Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/collection/TestPredicatedCollection.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/collection/TestSynchronizedCollection.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/collection/TestTransformedCollection.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/collection/TestUnmodifiableCollection.java Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java?view=diffrev=471578r1=471577r2=471578 == --- jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java (original) +++ jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java Sun Nov 5 16:11:13 2006 @@ -121,7 +121,7 @@ * @author Neil O'Toole * @author Stephen Colebourne */ -public abstract class AbstractTestCollection extends AbstractTestObject { +public abstract class AbstractTestCollectionT extends AbstractTestObject { // // NOTE: @@ -140,7 +140,7 @@ /** * A collection instance that will be used for testing. */ -public Collection collection; +public CollectionT collection; /** * Confirmed collection. This is an instance of a collection that is @@ -150,7 +150,7 @@ * collection, and then calling verify() to make sure your collection * still matches the confirmed collection. */ -public Collection confirmed; +public CollectionT confirmed; /** * JUnit constructor. @@ -262,7 +262,7 @@ // copy each collection value into an array Object[] confirmedValues = new Object[confirmedSize]; -Iterator iter; +IteratorT iter; iter = confirmed.iterator(); int pos = 0; @@ -340,7 +340,7 @@ * * @return a confirmed empty collection */ -public abstract Collection makeConfirmedCollection(); +public abstract CollectionT makeConfirmedCollection(); /** * Returns a confirmed full collection. @@ -350,12 +350,12 @@ * * @return a confirmed full collection */ -public abstract Collection makeConfirmedFullCollection(); +public abstract CollectionT makeConfirmedFullCollection(); /** * Return a new, empty [EMAIL PROTECTED] Collection} to be used for testing. */ -public abstract Collection makeCollection(); +public abstract CollectionT makeCollection(); /** * Returns a full collection to be used for testing. The collection @@ -365,8 +365,8 @@ * the results of [EMAIL PROTECTED] #getFullElements()}. Override this default * if your collection doesn't support addAll. */ -public Collection makeFullCollection() { -Collection c = makeCollection(); +public CollectionT makeFullCollection() { +CollectionT c = makeCollection(); c.addAll(Arrays.asList(getFullElements())); return c; } @@ -381,10 +381,10 @@ /** * Creates a new Map Entry that is independent of the first and the map. */ -public Map.Entry cloneMapEntry(Map.Entry entry) { -HashMap map = new HashMap(); +public Map.EntryT, T cloneMapEntry(Map.EntryT, T entry) { +HashMapT, T map = new HashMapT, T(); map.put(entry.getKey(), entry.getValue()); -return (Map.Entry) map.entrySet().iterator().next(); +return map.entrySet().iterator().next(); } //--- @@ -398,14 +398,14 @@ * override [EMAIL PROTECTED] #makeFullCollection()}, you Imust/I override * this method to reflect the contents of a full collection. */ -public Object[] getFullElements() { +public T[] getFullElements() { if (isNullSupported()) { -ArrayList list = new ArrayList(); +ArrayListT list = new ArrayListT(); list.addAll(Arrays.asList(getFullNonNullElements())); list.add(4, null); -
[jira] Commented: (COLLECTIONS-233) Closure is an inaccurate name
[ http://issues.apache.org/jira/browse/COLLECTIONS-233?page=comments#action_12447333 ] Holger Hoffstätte commented on COLLECTIONS-233: --- To this old Smalltalker Processor is IMHO not only very confusing (I immediately associate it with a CPU) but also sort of wrong: the block/closure/procedure/whateveryoucallit is not responsible for doing the actual processing (even though it ends up doing it); it is being processed or if you will performed on behalf of someone else. Action or Procedure (since it's void) would be much more appropriate. That being said, the notion that Lispers might be confused is a nonstarter because as far as I can tell they (just like most Smalltalkers) have completely given up on Java making sense anyway. There is really no value in renaming just for renaming's sake, especially considering that it will require unnecessary code rework without benefit. Closure is an inaccurate name - Key: COLLECTIONS-233 URL: http://issues.apache.org/jira/browse/COLLECTIONS-233 Project: Commons Collections Issue Type: Improvement Components: Collection Affects Versions: Generics Reporter: Stephen Kestle The Closure in commons collections is not named well: for non-functional programmers it will induce a what's that?, and for functional programmers it will confuse expectations. From http://en.wikipedia.org/wiki/Closure_(computer_science): A closure combines the code of a function with a special lexical environment bound to that function (scope). Java cannot pass functions, so the only way this can be done is with an (inner) class, as follows (also from wikipedia): class CalculationWindow extends JFrame { private JButton btnSave; ... public final calculateInSeparateThread(final URI uri) { // The expression new Runnable() { ... } is an anonymous class. Runnable runner = new Runnable() { void run() { // It can access final local variables: calculate(uri); // It can access private fields of the enclosing class: btnSave.setEnabled(true); } }; new Thread(runner).start(); } } Note how the Runnable accesses the btnSave variable in the function scope. This special lexical environment is NOT the same as passing a parameter through a constructor OR execute method. A Closure should NOT take a parameter for execute. It is not actually possible to have a Closure object, as that breaks the lexical environment. So, what to do? I would propose an interface called Processor. It is more intuitive and has many real world examples that can anchor the term so that it makes sense to the average programmer. For example, when applying for a passport, some documentation needs to be filled out, and then it will go through a process to get you a passport. You hand (or send) your forms to a clerk (Processor), and that's it. The Processor does not reply - the context that is passed in your form (your details) allows a message to be sent back at a later date. For backwards compatibility the interface would be public interface ProcessorT extends ClosureT{} with the appropriate documentation. Closure would be deprecated with an appropriate explanation. However, it may be acceptable with the new version just to do a rename. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r471579 - in /jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/buffer: AbstractBufferDecorator.java BlockingBuffer.java BoundedBu
Author: scolebourne Date: Sun Nov 5 16:14:58 2006 New Revision: 471579 URL: http://svn.apache.org/viewvc?view=revrev=471579 Log: Generify, remove getBuffer() - use covariant decorated() Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/buffer/AbstractBufferDecorator.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/buffer/BoundedBuffer.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/buffer/SynchronizedBuffer.java Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/buffer/AbstractBufferDecorator.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/buffer/AbstractBufferDecorator.java?view=diffrev=471579r1=471578r2=471579 == --- jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/buffer/AbstractBufferDecorator.java (original) +++ jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/buffer/AbstractBufferDecorator.java Sun Nov 5 16:14:58 2006 @@ -24,12 +24,15 @@ * p * Methods are forwarded directly to the decorated buffer. * + * @param E the type of the elements in the buffer * @since Commons Collections 3.0 * @version $Revision$ $Date$ * * @author Stephen Colebourne */ -public abstract class AbstractBufferDecorator extends AbstractCollectionDecorator implements Buffer { +public abstract class AbstractBufferDecoratorE +extends AbstractCollectionDecoratorE +implements BufferE { /** * Constructor only used in deserialization, do not use otherwise. @@ -45,7 +48,7 @@ * @param buffer the buffer to decorate, must not be null * @throws IllegalArgumentException if list is null */ -protected AbstractBufferDecorator(Buffer buffer) { +protected AbstractBufferDecorator(BufferE buffer) { super(buffer); } @@ -53,27 +56,17 @@ * Gets the buffer being decorated. * * @return the decorated buffer - * @deprecated use decorated() */ -protected Buffer getBuffer() { -return decorated(); -} - -/** - * Gets the buffer being decorated. - * - * @return the decorated buffer - */ -protected Buffer decorated() { -return (Buffer) super.decorated(); +protected BufferE decorated() { +return (BufferE) super.decorated(); } //--- -public Object get() { +public E get() { return decorated().get(); } -public Object remove() { +public E remove() { return decorated().remove(); } Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java?view=diffrev=471579r1=471578r2=471579 == --- jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java (original) +++ jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java Sun Nov 5 16:14:58 2006 @@ -45,10 +45,11 @@ * @author Janek Bogucki * @author Phil Steitz * @author James Carman + * @param E the type of the elements in the buffer * @version $Revision$ $Date$ * @since Commons Collections 3.0 */ -public class BlockingBuffer extends SynchronizedBuffer { +public class BlockingBufferE extends SynchronizedBufferE { /** Serialization version. */ private static final long serialVersionUID = 1719328905017860541L; @@ -58,25 +59,27 @@ /** * Factory method to create a blocking buffer. * + * @param t the type of the elements in the buffer * @param buffer the buffer to decorate, must not be null * @return a new blocking Buffer * @throws IllegalArgumentException if buffer is null */ -public static Buffer decorate(Buffer buffer) { -return new BlockingBuffer(buffer); +public static T BufferT decorate(BufferT buffer) { +return new BlockingBufferT(buffer); } /** * Factory method to create a blocking buffer with a timeout value. * +
svn commit: r471580 - in /jakarta/commons/proper/collections/branches/collections_jdk5_branch/src: java/org/apache/commons/collections/collection/ test/org/apache/commons/collections/collection/ test/
Author: scolebourne Date: Sun Nov 5 16:22:53 2006 New Revision: 471580 URL: http://svn.apache.org/viewvc?view=revrev=471580 Log: Generify CompositeCollection Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/CompositeCollection.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/collection/TestCompositeCollection.java jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/set/TestCompositeSet.java Modified: jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/CompositeCollection.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/CompositeCollection.java?view=diffrev=471580r1=471579r2=471580 == --- jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/CompositeCollection.java (original) +++ jakarta/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/collection/CompositeCollection.java Sun Nov 5 16:22:53 2006 @@ -21,6 +21,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Iterator; +import java.util.List; import org.apache.commons.collections.iterators.EmptyIterator; import org.apache.commons.collections.iterators.IteratorChain; @@ -33,6 +34,7 @@ * Add and remove operations require the use of a pluggable strategy. If no * strategy is provided then add and remove are unsupported. * + * @param E the type of the elements in the collection * @since Commons Collections 3.0 * @version $Revision$ $Date$ * @@ -40,42 +42,61 @@ * @author Stephen Colebourne * @author Phil Steitz */ -public class CompositeCollection implements Collection { +public class CompositeCollectionE implements CollectionE { /** CollectionMutator to handle changes to the collection */ -protected CollectionMutator mutator; +protected CollectionMutatorE mutator; /** Collections in the composite */ -protected Collection[] all; +protected ListCollectionE all = new ArrayListCollectionE(); /** * Create an empty CompositeCollection. */ public CompositeCollection() { super(); -this.all = new Collection[0]; } /** - * Create a Composite Collection with only coll composited. - * - * @param coll a collection to decorate + * Create a Composite Collection with one collection. + * + * @param compositeCollection the Collection to be appended to the composite */ -public CompositeCollection(Collection coll) { -this(); -this.addComposited(coll); +public CompositeCollection(CollectionE compositeCollection) { +super(); +addComposited(compositeCollection); } /** - * Create a CompositeCollection with colls as the initial list of - * composited collections. + * Create a Composite Collection with two collections. + * + * @param compositeCollection1 the Collection to be appended to the composite + * @param compositeCollection2 the Collection to be appended to the composite + */ +public CompositeCollection(CollectionE compositeCollection1, CollectionE compositeCollection2) { +super(); +addComposited(compositeCollection1, compositeCollection2); +} + +/** + * Create a Composite Collection with an array of collections. * - * @param colls an array of collections to decorate + * @param compositeCollections the collections to composite */ -public CompositeCollection(Collection[] colls) { -this(); -this.addComposited(colls); +public CompositeCollection(CollectionE[] compositeCollections) { +super(); +addComposited(compositeCollections); } +///** +// * Create a Composite Collection extracting the collections from an iterable. +// * +// * @param compositeCollections the collections to composite +// */ +//public CompositeCollection(IterableCollectionE compositeCollections) { +//super(); +//addComposited(compositeCollections); +//} + //--- /** * Gets the size of this composite collection. @@ -86,8 +107,8 @@ */ public int size() { int size = 0; -for (int i = this.all.length - 1; i = 0; i--) { -size += this.all[i].size(); +for (CollectionE item : all) { +size += item.size(); } return size; } @@ -100,8 +121,8 @@ * @return true if all of the contained
svn commit: r471610 - in /jakarta/commons/proper/dbutils/trunk/xdocs: navigation.xml todo.xml
Author: bayard Date: Sun Nov 5 18:13:01 2006 New Revision: 471610 URL: http://svn.apache.org/viewvc?view=revrev=471610 Log: Removed the Tasks page Removed: jakarta/commons/proper/dbutils/trunk/xdocs/todo.xml Modified: jakarta/commons/proper/dbutils/trunk/xdocs/navigation.xml Modified: jakarta/commons/proper/dbutils/trunk/xdocs/navigation.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/xdocs/navigation.xml?view=diffrev=471610r1=471609r2=471610 == --- jakarta/commons/proper/dbutils/trunk/xdocs/navigation.xml (original) +++ jakarta/commons/proper/dbutils/trunk/xdocs/navigation.xml Sun Nov 5 18:13:01 2006 @@ -36,7 +36,6 @@ item name=Javadoc href=apidocs/index.html/ item name=Mailing lists href=/mail-lists.html/ item name=Team href=/team-list.html/ - item name=Tasks href=/todo.html/ item name=CVS href=http://cvs.apache.org/viewcvs/jakarta-commons/dbutils// item name=Downloads href=/downloads.html/ /menu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r471611 - /jakarta/commons/proper/dbutils/trunk/project.xml
Author: bayard Date: Sun Nov 5 18:14:51 2006 New Revision: 471611 URL: http://svn.apache.org/viewvc?view=revrev=471611 Log: Adding Alan to the contributors section Modified: jakarta/commons/proper/dbutils/trunk/project.xml Modified: jakarta/commons/proper/dbutils/trunk/project.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/project.xml?view=diffrev=471611r1=471610r2=471611 == --- jakarta/commons/proper/dbutils/trunk/project.xml (original) +++ jakarta/commons/proper/dbutils/trunk/project.xml Sun Nov 5 18:14:51 2006 @@ -125,6 +125,12 @@ /roles /contributor contributor + nameAlan Canon/name + roles +roleJava Developer/role + /roles +/contributor +contributor nameStefan Fleiter/name email[EMAIL PROTECTED]/email roles - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r471613 - in /jakarta/commons/proper/dbutils/trunk/xdocs: downloads.xml navigation.xml
Author: bayard Date: Sun Nov 5 18:18:33 2006 New Revision: 471613 URL: http://svn.apache.org/viewvc?view=revrev=471613 Log: Killed the download page and linked to the standard one. Updated the scm link Removed: jakarta/commons/proper/dbutils/trunk/xdocs/downloads.xml Modified: jakarta/commons/proper/dbutils/trunk/xdocs/navigation.xml Modified: jakarta/commons/proper/dbutils/trunk/xdocs/navigation.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/xdocs/navigation.xml?view=diffrev=471613r1=471612r2=471613 == --- jakarta/commons/proper/dbutils/trunk/xdocs/navigation.xml (original) +++ jakarta/commons/proper/dbutils/trunk/xdocs/navigation.xml Sun Nov 5 18:18:33 2006 @@ -36,8 +36,8 @@ item name=Javadoc href=apidocs/index.html/ item name=Mailing lists href=/mail-lists.html/ item name=Team href=/team-list.html/ - item name=CVS href=http://cvs.apache.org/viewcvs/jakarta-commons/dbutils// - item name=Downloads href=/downloads.html/ + item name=Latest Source href=/cvs-usage.html/ + item name=Downloads href=http://jakarta.apache.org/site/downloads/downloads_commons-dbutils.cgi/ /menu common-menus; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r471625 - in /jakarta/commons/proper/beanutils/trunk/src: java/org/apache/commons/beanutils/converters/ test/org/apache/commons/beanutils/converters/
Author: niallp Date: Sun Nov 5 19:55:10 2006 New Revision: 471625 URL: http://svn.apache.org/viewvc?view=revrev=471625 Log: BEANUTILS-258 Add standard support for conversion to StringBuffer. Plus small refactoring in ArrayConverter 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/CharacterConverter.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/NumberConverter.java jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/converters/ArrayConverterTestCase.java jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/converters/ClassConverterTestCase.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=471625r1=471624r2=471625 == --- 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 Sun Nov 5 19:55:10 2006 @@ -150,9 +150,21 @@ if (value == null) { return handleMissing(targetType); -// Convert -- String -} else if (targetType.equals(String.class)) { -return convertToString(value); +// Convert -- String or StringBuffer +} else if (targetType.equals(String.class) || +targetType.equals(StringBuffer.class)) { +Object result = convertToString(value); +if (result == null) { +return getDefault(targetType); +} else if (type.equals(StringBuffer.class)) { +if (result instanceof StringBuffer) { +return result; +} else { +return new StringBuffer(result.toString()); +} +} else { +return result.toString(); +} // No conversion necessary } else if (targetType.equals(sourceType)) { @@ -179,18 +191,18 @@ } /** - * Convert the input object into a String. + * Convert the input object into a String (or StringBuffer). * p - * bN.B./bThis implementation simply uses the value's - * codetoString()/code method and should be overriden if a - * more sophisticated mechanism for iconversion to a String/i - * is required. + * bN.B./bThis implementation simply returns the value unchanged. + * The [EMAIL PROTECTED] AbstractConverter#convert(Class, Object)} method + * checks the value returned by this method, converting to either + * a String or StringBuffer as required. * * @param value The input value to be converted. * @return the converted String value. */ -protected String convertToString(Object value) { -return value.toString(); +protected Object convertToString(Object value) { +return value; } /** @@ -265,7 +277,7 @@ */ protected Object handleMissing(Class type) { -if (useDefault || type.equals(String.class)) { +if (useDefault || type.equals(String.class) || type.equals(StringBuffer.class)) { Object value = getDefault(type); if (useDefault value != null !(type.equals(value.getClass( { try { @@ -306,7 +318,13 @@ * @return The default value for the specified type. */ protected Object getDefault(Class type) { -return (type.equals(String.class) ? null : defaultValue); +if (type.equals(String.class)) { +return null; +} else if (type.equals(StringBuffer.class)) { +return new StringBuffer(); +} else { +return defaultValue; +} } // --- Package Methods 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=471625r1=471624r2=471625
svn commit: r471626 - in /jakarta/commons/proper/lang/trunk/src: java/org/apache/commons/lang/ java/org/apache/commons/lang/math/ java/org/apache/commons/lang/time/ test/org/apache/commons/lang/ test/
Author: bayard Date: Sun Nov 5 20:02:09 2006 New Revision: 471626 URL: http://svn.apache.org/viewvc?view=revrev=471626 Log: Removing my @author tags Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSetUtils.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/NumberUtils.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/RandomStringUtils.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/WordUtils.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/JVMRandom.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/NumberUtils.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/RandomUtils.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/StopWatch.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/CharSetUtilsTest.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringUtilsTest.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/WordUtilsTest.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java?view=diffrev=471626r1=471625r2=471626 == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java Sun Nov 5 20:02:09 2006 @@ -23,7 +23,6 @@ * * pInstances are immutable./p * - * @author Henri Yandell * @author Stephen Colebourne * @author Chris Feldhacker * @author Gary Gregory Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java?view=diffrev=471626r1=471625r2=471626 == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java Sun Nov 5 20:02:09 2006 @@ -28,7 +28,6 @@ * * pInstances are immutable, but instances of subclasses may not be./p * - * @author Henri Yandell * @author Stephen Colebourne * @author Phil Steitz * @author Pete Gieser Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSetUtils.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSetUtils.java?view=diffrev=471626r1=471625r2=471626 == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSetUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSetUtils.java Sun Nov 5 20:02:09 2006 @@ -24,7 +24,6 @@ * Each method documents its behaviour in more detail./p * * @see CharSet - * @author a href=[EMAIL PROTECTED]Henri Yandell/a * @author Stephen Colebourne * @author Phil Steitz * @author Gary Gregory Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/NumberUtils.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/NumberUtils.java?view=diffrev=471626r1=471625r2=471626 == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/NumberUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/NumberUtils.java Sun Nov 5 20:02:09 2006 @@ -22,7 +22,6 @@ /** * pProvides extra functionality for Java Number classes./p * - * @author a href=mailto:[EMAIL PROTECTED]Henri Yandell/a * @author a href=mailto:[EMAIL PROTECTED]Rand McNeely/a * @author Stephen Colebourne * @author a href=mailto:[EMAIL PROTECTED]Steve Downey/a Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/RandomStringUtils.java URL:
svn commit: r471627 - in /jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils: PropertyUtils.java PropertyUtilsBean.java
Author: niallp Date: Sun Nov 5 20:05:27 2006 New Revision: 471627 URL: http://svn.apache.org/viewvc?view=revrev=471627 Log: BEANUTILS-256 - Correct PropertyUtils javadoc to indicate the more general IndexOutOufBoundsException can be thrown (rather than just ArrayIndexOutOufBoundsException) - also re-throw any IndexOutOufBoundsException wrapped in an InvocationTargetException rather than just ArrayIndexOutOufBoundsException - thanks to Torsten Feig Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/PropertyUtils.java jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/PropertyUtilsBean.java Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/PropertyUtils.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/PropertyUtils.java?view=diffrev=471627r1=471626r2=471627 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/PropertyUtils.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/PropertyUtils.java Sun Nov 5 20:05:27 2006 @@ -201,8 +201,8 @@ * to be extracted * @return the indexed property value * - * @exception ArrayIndexOutOfBoundsException if the specified index - * is outside the valid range for the underlying array + * @exception IndexOutOfBoundsException if the specified index + * is outside the valid range for the underlying property * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception IllegalArgumentException if codebean/code or @@ -233,8 +233,8 @@ * @param index Index of the property value to be extracted * @return the indexed property value * - * @exception ArrayIndexOutOfBoundsException if the specified index - * is outside the valid range for the underlying array + * @exception IndexOutOfBoundsException if the specified index + * is outside the valid range for the underlying property * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception IllegalArgumentException if codebean/code or @@ -667,8 +667,8 @@ * @param value Value to which the specified property element * should be set * - * @exception ArrayIndexOutOfBoundsException if the specified index - * is outside the valid range for the underlying array + * @exception IndexOutOfBoundsException if the specified index + * is outside the valid range for the underlying property * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception IllegalArgumentException if codebean/code or @@ -700,8 +700,8 @@ * @param index Index of the property value to be set * @param value Value to which the indexed property element is to be set * - * @exception ArrayIndexOutOfBoundsException if the specified index - * is outside the valid range for the underlying array + * @exception IndexOutOfBoundsException if the specified index + * is outside the valid range for the underlying property * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception IllegalArgumentException if codebean/code or Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/PropertyUtilsBean.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/PropertyUtilsBean.java?view=diffrev=471627r1=471626r2=471627 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/PropertyUtilsBean.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/PropertyUtilsBean.java Sun Nov 5 20:05:27 2006 @@ -306,8 +306,8 @@ * to be extracted * @return the indexed property value * - * @exception ArrayIndexOutOfBoundsException if the specified index - * is outside the valid range for the underlying array + * @exception IndexOutOfBoundsException if the specified index + * is outside the valid range for the underlying array or List * @exception IllegalAccessException if the caller does not have * access to the property accessor method * @exception IllegalArgumentException if codebean/code or @@ -362,8 +362,8 @@ * @param index Index of the property value to be extracted * @return the indexed property value * - * @exception ArrayIndexOutOfBoundsException if the specified index - * is outside the valid range for the
svn commit: r471628 - in /jakarta/commons/proper: beanutils/trunk/src/java/org/apache/commons/beanutils/converters/ beanutils/trunk/src/test/org/apache/commons/beanutils/converters/ collections/trunk/
Author: bayard Date: Sun Nov 5 20:06:45 2006 New Revision: 471628 URL: http://svn.apache.org/viewvc?view=revrev=471628 Log: Removing my @author tag Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/URLConverter.java jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/converters/URLConverterTestCase.java jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/comparators/ComparableComparator.java jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/comparators/ReverseComparator.java jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/ListOrderedMap.java jakarta/commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/TestListOrderedMap.java jakarta/commons/proper/collections/trunk/src/test/org/apache/commons/collections/map/TestListOrderedMap2.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/AbstractFileFilter.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/DelegateFileFilter.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/DirectoryFileFilter.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/FalseFileFilter.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/FileFilterUtils.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/IOFileFilter.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/NameFileFilter.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/PrefixFileFilter.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/SuffixFileFilter.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/TrueFileFilter.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/input/CountingInputStream.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/input/ProxyInputStream.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/input/ProxyReader.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/output/CountingOutputStream.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/output/ProxyOutputStream.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/output/ProxyWriter.java jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/output/TeeOutputStream.java jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/EndianUtilsTest.java jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/input/CountingInputStreamTest.java jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/input/SwappedDataInputStreamTest.java jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/output/CountingOutputStreamTest.java jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/output/LockableFileWriterTest.java jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/output/NullOutputStreamTest.java jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/output/TeeOutputStreamTest.java Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/URLConverter.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/URLConverter.java?view=diffrev=471628r1=471627r2=471628 == --- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/URLConverter.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/URLConverter.java Sun Nov 5 20:06:45 2006 @@ -27,7 +27,6 @@ * Can be configured to either return a idefault value/i or throw a * codeConversionException/code if a conversion error occurs. * - * @author Henri Yandell * @version $Revision$ $Date$ * @since 1.3 */ Modified: jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/converters/URLConverterTestCase.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/converters/URLConverterTestCase.java?view=diffrev=471628r1=471627r2=471628 == --- jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/converters/URLConverterTestCase.java (original) +++ jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/converters/URLConverterTestCase.java Sun Nov 5 20:06:45 2006 @@ -28,7 +28,6 @@ /** * Test Case for the URLConverter class. * - * @author Henri Yandell *
[jira] Resolved: (BEANUTILS-256) getIndexedProperty() should javadoc IndexOutOufBoundsException
[ http://issues.apache.org/jira/browse/BEANUTILS-256?page=all ] Niall Pemberton resolved BEANUTILS-256. --- Fix Version/s: 1.8.0 Resolution: Fixed Assignee: Niall Pemberton As well as the getIndexedProperty methods, the same issue was there for the corresponding setIndexedProperty methods as well. Also these methods were trapping InvocationTargetExceptions and re-throwing ArrayIndexOutOufBoundsException - modified to re-throw any IndexOutOfBoundsException. getIndexedProperty() should javadoc IndexOutOufBoundsException -- Key: BEANUTILS-256 URL: http://issues.apache.org/jira/browse/BEANUTILS-256 Project: Commons BeanUtils Issue Type: Bug Affects Versions: 1.7.0 Reporter: Torsten Feig Assigned To: Niall Pemberton Priority: Trivial Fix For: 1.8.0 PropertyUtilsBean.getIndexedProperty()'s javadoc declares to throw ArrayIndexOutOfBoundsException, which is correct since the code can access an array. But it can also access a list and therefor throw an IndexOutOufBoundsException, so it should be mentioned in the javadoc as well. Since ArrayIndexOutOfBoundsException is a variation of IndexOutOufBoundsException with essentially the same meaning, one could limit oneself to IndexOutOufBoundsException. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r471630 - in /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang: EntitiesTest.java StringEscapeUtilsTest.java
Author: bayard Date: Sun Nov 5 20:14:45 2006 New Revision: 471630 URL: http://svn.apache.org/viewvc?view=revrev=471630 Log: Removing @author query Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/EntitiesTest.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/EntitiesTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/EntitiesTest.java?view=diffrev=471630r1=471629r2=471630 == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/EntitiesTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/EntitiesTest.java Sun Nov 5 20:14:45 2006 @@ -26,7 +26,6 @@ /** * Unit tests for [EMAIL PROTECTED] StringEscapeUtils}. * - * @author of original StringUtilsTest.testEscape = ? * @author a href=mailto:[EMAIL PROTECTED]Alexander Day Chaffee/a * @author a href=mailto:[EMAIL PROTECTED]Gary Gregory/a * @version $Id$ Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java?view=diffrev=471630r1=471629r2=471630 == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java Sun Nov 5 20:14:45 2006 @@ -29,7 +29,6 @@ /** * Unit tests for [EMAIL PROTECTED] StringEscapeUtils}. * - * @author of original StringUtilsTest.testEscape = ? * @author a href=mailto:[EMAIL PROTECTED]Alexander Day Chaffee/a * @version $Id$ */ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r471633 - in /jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils: MockResultSet.java MockResultSetMetaData.java
Author: bayard Date: Sun Nov 5 20:45:35 2006 New Revision: 471633 URL: http://svn.apache.org/viewvc?view=revrev=471633 Log: Switch from Boolean.valueOf(boolean) to new Boolean(boolean) to support tests under 1.3 Modified: jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java Modified: jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java?view=diffrev=471633r1=471632r2=471633 == --- jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java (original) +++ jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java Sun Nov 5 20:45:35 2006 @@ -312,7 +312,7 @@ return MockResultSet + System.identityHashCode(proxy); } else if (methodName.equals(equals)) { -return Boolean.valueOf(proxy == args[0]); +return new Boolean(proxy == args[0]); } throw new UnsupportedOperationException(Unsupported method: + methodName); Modified: jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java?view=diffrev=471633r1=471632r2=471633 == --- jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java (original) +++ jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java Sun Nov 5 20:45:35 2006 @@ -70,7 +70,7 @@ return MockResultSetMetaData + System.identityHashCode(proxy); } else if (methodName.equals(equals)) { -return Boolean.valueOf(proxy == args[0]); +return new Boolean(proxy == args[0]); } else { throw new UnsupportedOperationException(Unsupported method: + methodName); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r471634 - /jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java
Author: bayard Date: Sun Nov 5 20:46:20 2006 New Revision: 471634 URL: http://svn.apache.org/viewvc?view=revrev=471634 Log: Switched the URL test to use reflection so it works under a 1.3 build Modified: jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java Modified: jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java?view=diffrev=471634r1=471633r2=471634 == --- jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java (original) +++ jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java Sun Nov 5 20:46:20 2006 @@ -462,18 +462,41 @@ } /** - * Tests the getURL implementation. - */ -public void testGetURL() throws SQLException, MalformedURLException { -assertEquals(null, rs.getURL(1)); -assertTrue(rs.wasNull()); -assertEquals(null, rs.getURL(column)); -assertTrue(rs.wasNull()); -// Set what gets returned to something other than the default -URL u = new URL(http://www.apache.org;); -rs2.setNullURL(u); -assertEquals(u, rs.getURL(1)); -assertEquals(u, rs.getURL(column)); + * Tests the getURL and setNullURL implementations. + * + * Uses reflection to allow for building under JDK 1.3. + */ +public void testURL() throws SQLException, MalformedURLException, +IllegalAccessException, IllegalArgumentException, +java.lang.reflect.InvocationTargetException +{ +Method getUrlInt = null; +Method getUrlString = null; +try { +getUrlInt = ResultSet.class.getMethod(getURL, +new Class[] { Integer.TYPE } ); +getUrlString = ResultSet.class.getMethod(getURL, + new Class[] { String.class } ); +} catch(NoSuchMethodException e) { +// ignore +} catch(SecurityException e) { +// ignore +} +if (getUrlInt != null getUrlString != null) { +assertEquals(null, getUrlInt.invoke(rs, + new Object[] { new Integer(1) } ) ); +assertTrue(rs.wasNull()); +assertEquals(null, getUrlString.invoke(rs, + new Object[] { column } ) ); +assertTrue(rs.wasNull()); +// Set what gets returned to something other than the default +URL u = new URL(http://www.apache.org;); +rs2.setNullURL(u); +assertEquals(u, getUrlInt.invoke(rs, + new Object[] { new Integer(1) } ) ); +assertEquals(u, getUrlString.invoke(rs, + new Object[] { column } ) ); +} } /** @@ -784,17 +807,6 @@ assertEquals(ts, rs.getTimestamp(column, Calendar.getInstance())); } -/** - * Tests the setNullString implementation. - */ -public void testSetNullURL() throws SQLException, MalformedURLException { -assertEquals(null, rs2.getNullURL()); -// Set what gets returned to something other than the default -URL u = new URL(http://jakarta.apache.org;); -rs2.setNullURL(u); -assertEquals(u, rs.getURL(1)); -assertEquals(u, rs.getURL(column)); -} } class SqlNullUncheckedMockResultSet implements InvocationHandler { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r471635 - in /jakarta/commons/proper/dbutils/trunk: build.xml lib/ lib/README.txt
Author: bayard Date: Sun Nov 5 20:47:54 2006 New Revision: 471635 URL: http://svn.apache.org/viewvc?view=revrev=471635 Log: Support a 1.3 build - a jdbc2_0-stdext.jar file needs to be put into lib/ Added: jakarta/commons/proper/dbutils/trunk/lib/ jakarta/commons/proper/dbutils/trunk/lib/README.txt (with props) Modified: jakarta/commons/proper/dbutils/trunk/build.xml Modified: jakarta/commons/proper/dbutils/trunk/build.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/build.xml?view=diffrev=471635r1=471634r2=471635 == --- jakarta/commons/proper/dbutils/trunk/build.xml (original) +++ jakarta/commons/proper/dbutils/trunk/build.xml Sun Nov 5 20:47:54 2006 @@ -91,8 +91,6 @@ junit dir=./ failureproperty=test.failure printSummary=yes fork=true haltonerror=true sysproperty key=basedir value=. /sysproperty - formatter type=xml - /formatter formatter usefile=false type=plain /formatter classpath @@ -156,12 +154,13 @@ target name=get-deps unless=noget depends=init get dest=${libdir}/junit-3.8.1.jar usetimestamp=true ignoreerrors=true src=http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.jar; /get -get dest=${libdir}/junit-3.8.1.jar usetimestamp=true ignoreerrors=true src=http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.jar; -/get get dest=${libdir}/ant-1.5.jar usetimestamp=true ignoreerrors=true src=http://www.ibiblio.org/maven/ant/jars/ant-1.5.jar; /get get dest=${libdir}/ant-optional-1.5.jar usetimestamp=true ignoreerrors=true src=http://www.ibiblio.org/maven/ant/jars/ant-optional-1.5.jar; /get +echo message=Pay no attention if there is a subsequent warning if building under JDK 1.4+/ +copy file=lib/jdbc2_0-stdext.jar todir=${libdir} failonerror=false +/copy /target target name=install-maven get dest=${user.home}/maven-install-latest.jar usetimestamp=true src=${repo}/maven/maven-install-latest.jar @@ -169,4 +168,4 @@ unjar dest=${maven.home} src=${user.home}/maven-install-latest.jar /unjar /target -/project \ No newline at end of file +/project Added: jakarta/commons/proper/dbutils/trunk/lib/README.txt URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/lib/README.txt?view=autorev=471635 == --- jakarta/commons/proper/dbutils/trunk/lib/README.txt (added) +++ jakarta/commons/proper/dbutils/trunk/lib/README.txt Sun Nov 5 20:47:54 2006 @@ -0,0 +1,3 @@ + +If building under JDK 1.3, copy the JDBC 2.0 Optional Package (jdbc2_0-stdext.jar) +from http://java.sun.com/products/jdbc/download.html and place it in this directory. Propchange: jakarta/commons/proper/dbutils/trunk/lib/README.txt -- svn:eol-style = native - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-256) getIndexedProperty() should javadoc IndexOutOufBoundsException
[ http://issues.apache.org/jira/browse/BEANUTILS-256?page=all ] Niall Pemberton updated BEANUTILS-256: -- Component/s: Utils (Bean, Property, Method) getIndexedProperty() should javadoc IndexOutOufBoundsException -- Key: BEANUTILS-256 URL: http://issues.apache.org/jira/browse/BEANUTILS-256 Project: Commons BeanUtils Issue Type: Bug Components: Utils (Bean, Property, Method) Affects Versions: 1.7.0 Reporter: Torsten Feig Assigned To: Niall Pemberton Priority: Trivial Fix For: 1.8.0 PropertyUtilsBean.getIndexedProperty()'s javadoc declares to throw ArrayIndexOutOfBoundsException, which is correct since the code can access an array. But it can also access a list and therefor throw an IndexOutOufBoundsException, so it should be mentioned in the javadoc as well. Since ArrayIndexOutOfBoundsException is a variation of IndexOutOufBoundsException with essentially the same meaning, one could limit oneself to IndexOutOufBoundsException. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r471636 - /jakarta/commons/proper/dbutils/trunk/RELEASE-NOTES.txt
Author: bayard Date: Sun Nov 5 21:00:39 2006 New Revision: 471636 URL: http://svn.apache.org/viewvc?view=revrev=471636 Log: Fixed url Modified: jakarta/commons/proper/dbutils/trunk/RELEASE-NOTES.txt Modified: jakarta/commons/proper/dbutils/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/RELEASE-NOTES.txt?view=diffrev=471636r1=471635r2=471636 == --- jakarta/commons/proper/dbutils/trunk/RELEASE-NOTES.txt (original) +++ jakarta/commons/proper/dbutils/trunk/RELEASE-NOTES.txt Sun Nov 5 21:00:39 2006 @@ -6,7 +6,7 @@ You can find release notes for this and past releases online at -http://jakarta.apache.org/commons/validator/changes-report.html +http://jakarta.apache.org/commons/dbutils/changes-report.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r471638 - /jakarta/commons/proper/dbutils/trunk/xdocs/changes.xml
Author: bayard Date: Sun Nov 5 21:05:01 2006 New Revision: 471638 URL: http://svn.apache.org/viewvc?view=revrev=471638 Log: Switching Bugzilla IDs to JIRA Modified: jakarta/commons/proper/dbutils/trunk/xdocs/changes.xml Modified: jakarta/commons/proper/dbutils/trunk/xdocs/changes.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/xdocs/changes.xml?view=diffrev=471638r1=471637r2=471638 == --- jakarta/commons/proper/dbutils/trunk/xdocs/changes.xml (original) +++ jakarta/commons/proper/dbutils/trunk/xdocs/changes.xml Sun Nov 5 21:05:01 2006 @@ -38,22 +38,22 @@ /properties body -release version=1.1-dev date=in CVS - action dev=dgraham type=add issue=32120 +release version=1.1-dev date=in SVN + action dev=dgraham type=add issue=DBUTILS-4 Added protected ResultSetIterator.rethrow() method to wrap SQLExceptions in RuntimeExceptions. /action - action dev=dgraham type=update issue=33614 + action dev=dgraham type=update issue=DBUTILS-5 Added SQLState and error code to rethrown SQLExceptions. /action - action dev=dgraham type=add issue=31446 + action dev=dgraham type=add issue=DBUTILS-25 Added KeyedHandler to create a Map of Maps from a ResultSet. /action - action dev=dgraham type=update issue=31169 + action dev=dgraham type=update issue=DBUTILS-2 Use current class' ClassLoader instead of QueryLoader's ClassLoader in loadQueries(). /action - action dev=dgraham type=update issue=31460 + action dev=dgraham type=update issue=DBUTILS-22 Made QueryLoader.loadQueries() protected so subclasses can use query repositories other than properties files. /action @@ -64,19 +64,19 @@ action dev=dgraham type=add Added DbUtils.rollbackAndClose() and DbUtils.rollbackAndCloseQuietly(). /action - action dev=dgraham type=update issue=30749 + action dev=dgraham type=update issue=DBUTILS-26 Call ResultSet.getTimestamp() in BeanProcessor.processColumn() if the bean property is a java.sql.Timestamp. Oracle's getObject() implementation returns its own incompatible Timestamp class. /action - action dev=dgraham type=update issue=29212 + action dev=dgraham type=update issue=DBUTILS-18 Changed QueryRunner.fillStatement() null handling to use Types.VARCHAR instead of Types.OTHER. This works for the following tested drivers: Firebird 1.5/firebirdsql 1.5RC3, Oracle 9/ Thin driver, MySQL 4.0/Msql Connecttor 3.0 and mm.mysql 2.0.4 MaxDB 7.5, HSQLDB 1.7.1, and MS Access/ODBC Bridge. /action - action dev=dgraham type=add issue=30032 + action dev=dgraham type=add issue=DBUTILS-21 Added a protected QueryRunner.prepareConnection() method to allow subclasses to customize the Connections retrieved from the DataSource before they're used. @@ -86,10 +86,10 @@ BeanProcessor class. This also fixes the common problem with Oracle NUMERIC fields not being set into bean properties. /action - action dev=dgraham type=add issue=27530 + action dev=dgraham type=add issue=DBUTILS-13 Added QueryRunner.batch() methods for batch updates. /action - action dev=dgraham type=add issue=27377 + action dev=dgraham type=add issue=DBUTILS-11 Added new ResultSetHandler implementation, ColumnListHandler, that converts one ResultSet column into a List of Objects. /action @@ -121,4 +121,4 @@ /release /body -/document \ No newline at end of file +/document - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Commented: (BEANUTILS-252) getNestedProperty doesn't work with maps properly
[ http://issues.apache.org/jira/browse/BEANUTILS-252?page=comments#action_12447361 ] Niall Pemberton commented on BEANUTILS-252: --- You're right that BeanUtils doesn't support this, though I'm wondering why you don't simply leave out the brackets all together? You can simply do the following: HashMap myMap = new HashMap(); myMap.put(key,value); Request: System.out.println(PropertyUtils.getProperty(myMap, key)); Another point is that the code you posted from PropertyUtilsBean has changed since the last release - rather than accesssing the Map from the getNestedProperty() method it now delegates to a new getPropertyOfMapBean() method - which means you can override that method and implement your own custom behaviour. Theres a number of bugs open in BeanUtils regarding how the keys to Maps should be handled - with opposing points of view on what characters should be allowed. Therefore I think we should close this as WONT FIX since there is now a mechanism for people to resovle this easily themselves. getNestedProperty doesn't work with maps properly - Key: BEANUTILS-252 URL: http://issues.apache.org/jira/browse/BEANUTILS-252 Project: Commons BeanUtils Issue Type: Bug Affects Versions: 1.7.0 Environment: Any Reporter: Masker71 Hello, Here is an example of PropertyUtils.getProperty use: HashMap myMap = new HashMap(); myMap.put(key,value); Request: System.out.println(PropertyUtils.getProperty(myMap, (key))); Result: null Workaround: HashMap myMap = new HashMap(); myMap.put((key),value); Request: System.out.println(PropertyUtils.getProperty(myMap, (key))); Result: value The reason of this behaviour is that in the implementation of PropertyUtilsBean.getNestedProperty function. Currently it doesn't extract 'key' from brackets. variable name is equal to (key) when this method is invoked and it is used to extract value from the map: indexOfINDEXED_DELIM = name.indexOf(PropertyUtils.INDEXED_DELIM); indexOfMAPPED_DELIM = name.indexOf(PropertyUtils.MAPPED_DELIM); if (bean instanceof Map) { bean = ((Map) bean).get(name); } else if (indexOfMAPPED_DELIM = 0) { bean = getMappedProperty(bean, name); } else if (indexOfINDEXED_DELIM = 0) { bean = getIndexedProperty(bean, name); } else { bean = getSimpleProperty(bean, name); } For the bean methods which returs maps key extraction is performed, why it isn't done for the Map? Cannot I use any string as a key in the map, why should I use keys enveloped in brackets? I think what is mentioned to do is that: indexOfINDEXED_DELIM = name.indexOf(PropertyUtils.INDEXED_DELIM); indexOfMAPPED_DELIM = name.indexOf(PropertyUtils.MAPPED_DELIM); indexOfMAPPED_DELIM2 = name.indexOf(PropertyUtils.MAPPED_DELIM2); if (bean instanceof Map) { if (indexOfMAPPED_DELIM = 0 indexOfMAPPED_DELIM2=0) name = name.substring(indexOfMAPPED_DELIM+1, indexOfMAPPED_DELIM2); bean = ((Map) bean).get(name); } Hope description was clear enough and you will approve it as a bug. Thank you -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-252) getNestedProperty doesn't work with maps properly
[ http://issues.apache.org/jira/browse/BEANUTILS-252?page=all ] Niall Pemberton updated BEANUTILS-252: -- Component/s: Utils (Bean, Property, Method) getNestedProperty doesn't work with maps properly - Key: BEANUTILS-252 URL: http://issues.apache.org/jira/browse/BEANUTILS-252 Project: Commons BeanUtils Issue Type: Bug Components: Utils (Bean, Property, Method) Affects Versions: 1.7.0 Environment: Any Reporter: Masker71 Hello, Here is an example of PropertyUtils.getProperty use: HashMap myMap = new HashMap(); myMap.put(key,value); Request: System.out.println(PropertyUtils.getProperty(myMap, (key))); Result: null Workaround: HashMap myMap = new HashMap(); myMap.put((key),value); Request: System.out.println(PropertyUtils.getProperty(myMap, (key))); Result: value The reason of this behaviour is that in the implementation of PropertyUtilsBean.getNestedProperty function. Currently it doesn't extract 'key' from brackets. variable name is equal to (key) when this method is invoked and it is used to extract value from the map: indexOfINDEXED_DELIM = name.indexOf(PropertyUtils.INDEXED_DELIM); indexOfMAPPED_DELIM = name.indexOf(PropertyUtils.MAPPED_DELIM); if (bean instanceof Map) { bean = ((Map) bean).get(name); } else if (indexOfMAPPED_DELIM = 0) { bean = getMappedProperty(bean, name); } else if (indexOfINDEXED_DELIM = 0) { bean = getIndexedProperty(bean, name); } else { bean = getSimpleProperty(bean, name); } For the bean methods which returs maps key extraction is performed, why it isn't done for the Map? Cannot I use any string as a key in the map, why should I use keys enveloped in brackets? I think what is mentioned to do is that: indexOfINDEXED_DELIM = name.indexOf(PropertyUtils.INDEXED_DELIM); indexOfMAPPED_DELIM = name.indexOf(PropertyUtils.MAPPED_DELIM); indexOfMAPPED_DELIM2 = name.indexOf(PropertyUtils.MAPPED_DELIM2); if (bean instanceof Map) { if (indexOfMAPPED_DELIM = 0 indexOfMAPPED_DELIM2=0) name = name.substring(indexOfMAPPED_DELIM+1, indexOfMAPPED_DELIM2); bean = ((Map) bean).get(name); } Hope description was clear enough and you will approve it as a bug. Thank you -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-251) PropertyUtils.describe() returns wrong fields names
[ http://issues.apache.org/jira/browse/BEANUTILS-251?page=all ] Niall Pemberton updated BEANUTILS-251: -- Component/s: Utils (Bean, Property, Method) PropertyUtils.describe() returns wrong fields names --- Key: BEANUTILS-251 URL: http://issues.apache.org/jira/browse/BEANUTILS-251 Project: Commons BeanUtils Issue Type: Bug Components: Utils (Bean, Property, Method) Affects Versions: 1.7.0 Environment: WinXP SP2 Reporter: Oleg Timoshenko Assigned To: Henri Yandell Fix For: 1.8.0 I have the following bean: public class SumTestBean2 { private int iVal; public int getIVal() { return iVal; } public void setIVal(int val) { iVal = val; } } ... and the following snippet of code: SumTestBean2 stb = new SumTestBean2(); stb.setIVal(12); Map map = PropertyUtils.describe(stb); for(Object o : map.keySet()) System.out.println(o); .. prints out the following: IVal class Note that instead of IVal there should be iVal - uppercase letter appears instead of lowercase. This happens only when field has first letter - in lower case followed by uppercase letter. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-249) BeanUtilsBean does not convert objects using custom convertors properly
[ http://issues.apache.org/jira/browse/BEANUTILS-249?page=all ] Niall Pemberton updated BEANUTILS-249: -- Component/s: Converters BeanUtilsBean does not convert objects using custom convertors properly --- Key: BEANUTILS-249 URL: http://issues.apache.org/jira/browse/BEANUTILS-249 Project: Commons BeanUtils Issue Type: Bug Components: Converters Affects Versions: 1.7.0 Environment: Linux/Java5 Reporter: Brad Priority: Critical Fix For: 1.8.0 BeanUtilsBean.setProperty(Object bean, String name, Object value) cannot properly convert any custom class using convertor. Line 1007 It calls toString() on every object regardless of its type (unless it was a string or an array). This prevent custom convertors from functioning. } else if (getConvertUtils().lookup(value.getClass()) != null) { newValue = getConvertUtils().convert(value.toString(), type); //--- WRONG! } else { newValue = value; } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - 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
[ http://issues.apache.org/jira/browse/BEANUTILS-248?page=all ] Niall Pemberton updated BEANUTILS-248: -- Component/s: Utils (Bean, Property, Method) Code to create a JavaBean and set its properties from a Java Properties instance Key: BEANUTILS-248 URL: http://issues.apache.org/jira/browse/BEANUTILS-248 Project: Commons BeanUtils Issue Type: Improvement Components: Utils (Bean, Property, Method) Environment: Coded on Windows XP professional with Netbean 5.5 Beta 2 using JDK 1.5.0 Reporter: Trevor Charles Miller Priority: Minor 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-247) Arrays with multiple dimension are not supported
[ http://issues.apache.org/jira/browse/BEANUTILS-247?page=all ] Niall Pemberton updated BEANUTILS-247: -- Component/s: Utils (Bean, Property, Method) Arrays with multiple dimension are not supported Key: BEANUTILS-247 URL: http://issues.apache.org/jira/browse/BEANUTILS-247 Project: Commons BeanUtils Issue Type: Bug Components: Utils (Bean, Property, Method) Affects Versions: 1.7.0 Environment: I run BeanUtils on Windows XP with Eclipse 3.1.1. Reporter: Christian Poitras Attachments: beanerror.zip, PropertyUtilsBean.java When an array with multiple dimension is used, accessing and setting properties is not supported. For instance, the call to PropertyUtils.getNestedProperty(myObject, multiArray[0][0].id) fails since the second array index is never used. This raises the following exception. Exception in thread main java.lang.NoSuchMethodException: Unknown property 'id' at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1122) at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:272) at Test.main(Test.java:24) The id property does exists in the object multiArray[0][0] and if I make a call to multiArray[0][0].getId(), the correct value is returned. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-244) [collections] Add a multi property beancomparator
[ http://issues.apache.org/jira/browse/BEANUTILS-244?page=all ] Niall Pemberton updated BEANUTILS-244: -- Bugzilla Id: (was: 39008) Component/s: Bean-Collections [collections] Add a multi property beancomparator - Key: BEANUTILS-244 URL: http://issues.apache.org/jira/browse/BEANUTILS-244 Project: Commons BeanUtils Issue Type: New Feature Components: Bean-Collections Environment: Operating System: Windows XP Platform: All Reporter: Baptiste MATHUS Priority: Minor Hi, I recently needed to be able to sort a list of beans on many properties. So I thought I would try and pick one of the collections comparators. I had to to the sorting close to the sql way : be able to sort on n properties, some ascending, some descending. I haven't found what I'm looking for (:p), but I found some comparators in the commons I used to do this : I used BeanComparator, NullComparator and ComparatorChain to create a class : MultiPropertyBeanComparator. Is there already something in one of the commons package that could be used instead of it ? If not, I'd be glad to contribute the small piece of code if wanted. It has dependencies against commons-beanutils (BeanComparator, which is moving from one package to another at the moment, no ?) and commons-lang (StringUtils.isBlank()). I think some things might not satisfactory for everybody, but hey, could still be improved without problems, that's not big work :p. As adviced on the user mailing list, I'm posting the code on this bugzilla, so as maybe one of the coder could take a look at it. Here it is : === import java.io.Serializable; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import org.apache.commons.beanutils.BeanComparator; import org.apache.commons.collections.ComparatorUtils; import org.apache.commons.collections.comparators.NullComparator; import org.apache.commons.collections.comparators.ReverseComparator; import org.apache.commons.lang.StringUtils; /** * This comparator lets you sort a list using a list of properties. You can specify ascending or * descending order on these properties. * p * For example, if you want to sort with natural order a list of beans with properties firstname, * nickname and address, sorting the firstname descending, you can do it this way: * /p * codeList l = .../code * code.../code * codeMultiPropertyBeanComparator multiPropBeanComp = new MultiPropertyBeanComparator();/code * codemultiPropBeanComp.append(firstname, true).append(nickname).append(address);/code * codeCollections.sort(l,multiPropBeanComp);/code * * @author Baptiste MATHUS */ public class MultiPropertyBeanComparator implements Comparator, Serializable { private static final long serialVersionUID = -1431852774261001458L; private List comparatorList = new ArrayList(); /** * Use this method to add a comparator to the list. * * @param property *the property on which to apply the given comparator. * @param comparator *the comparator to be added. If null, natural order will be used. * @param reverse *p *must be true if the given comparator must be used in opposite order to sort. For *example, if the comparator is designed to sort in ascending order, put this *parameter to codetrue/code if you want descending order. */p *p *If the comparator is null, then the reversed natural order is used. */p */ public MultiPropertyBeanComparator append(String property, Comparator comparator, boolean reverse) { if (StringUtils.isBlank(property)) { throw new IllegalArgumentException(The given property is blank); } // If the comparator is null, then compare only on the given property // with a natural sort. if (comparator == null) { comparator = new BeanComparator(property, new NullComparator(false)); } // Else : compare on the property, but with given comparator. else { comparator = new BeanComparator(property, comparator); } // Here, the comparator cannot be null anymore, so reverse it if // necessary. if (reverse) { comparator = new ReverseComparator(comparator); }
[jira] Updated: (BEANUTILS-242) Add general array type conversion
[ http://issues.apache.org/jira/browse/BEANUTILS-242?page=all ] Niall Pemberton updated BEANUTILS-242: -- Component/s: Converters Add general array type conversion - Key: BEANUTILS-242 URL: http://issues.apache.org/jira/browse/BEANUTILS-242 Project: Commons BeanUtils Issue Type: New Feature Components: Converters Affects Versions: 1.7.0 Reporter: Kenny MacLeod When using a method such as BeanUtils.copyProperty(), it would be good if it could automatically handle conversion between array types, rather than having to explicitly write an array converter for each target type. For example, if I pass a String[] to BeanUtils to copy on to a property of type Integer[], then it would recognise the presense of an array, and then use the registered converters for the arrays' component types to decide how to map them together. This would remove the need to essentially duplicate converters already written, just to add array support. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-238) [beanutils] Add nullate utilities
[ http://issues.apache.org/jira/browse/BEANUTILS-238?page=all ] Niall Pemberton updated BEANUTILS-238: -- Bugzilla Id: (was: 27074) Component/s: Bean / Property Utils [beanutils] Add nullate utilities - Key: BEANUTILS-238 URL: http://issues.apache.org/jira/browse/BEANUTILS-238 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: other Platform: Other Reporter: Marc Guillemot Priority: Minor It's a common task to reset all properties of an object to null (or to default values for primitives), for instance in Struts in the reset method of subclasses of ActionForm. It would be usefull to have something like - nullateProperties(Object _o) to nullate the properties of _o declared by the class of _o - nullateProperties(Object _o, Class _clazz) to nullate the properties of _o declared by _clazz - nullateProperties(Object _o, Class _clazz, boolean _bAncestorsToo) to nullate the properties of _o declared by _clazz and its ancestors -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-237) [beanutils] Add aggressive mode for BeanUtils.copyProperty()
[ http://issues.apache.org/jira/browse/BEANUTILS-237?page=all ] Niall Pemberton updated BEANUTILS-237: -- Bugzilla Id: (was: 21076) Component/s: Bean / Property Utils [beanutils] Add aggressive mode for BeanUtils.copyProperty() -- Key: BEANUTILS-237 URL: http://issues.apache.org/jira/browse/BEANUTILS-237 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: other Platform: Other Reporter: apachebugs Priority: Minor Currently, the Beanutils.copyProperty() method behaves as per the javadoc: If the specified bean does not have a property of the specified name, or the property is read only on the destination bean, return without doing anything It would be good if the method could take an optional extra parameter which indicated whether or not this behaviour should be more aggressive, i.e. if the bean does not have a read-write property of the appropriate name, then throw an exception. An overloaded copyProperty() is the obvious choice. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-235) [beanutils] Need getPropertyType(Class theClass, String propName)
[ http://issues.apache.org/jira/browse/BEANUTILS-235?page=all ] Niall Pemberton updated BEANUTILS-235: -- Bugzilla Id: (was: 13743) Component/s: Bean / Property Utils [beanutils] Need getPropertyType(Class theClass, String propName) - Key: BEANUTILS-235 URL: http://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: 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-233) [beanutils] DynaProperty doesn't override equals or hashCode
[ http://issues.apache.org/jira/browse/BEANUTILS-233?page=all ] Niall Pemberton updated BEANUTILS-233: -- Bugzilla Id: (was: 34457) Component/s: DynaBean [beanutils] DynaProperty doesn't override equals or hashCode Key: BEANUTILS-233 URL: http://issues.apache.org/jira/browse/BEANUTILS-233 Project: Commons BeanUtils Issue Type: Improvement Components: DynaBean Affects Versions: Nightly Builds Environment: Operating System: All Platform: All Reporter: Russell Priority: Minor Attachments: DynaPropertyTestCase.java, patchfile.txt Meaningful implementations of these methods are necessary for implementing the same methods in classes that use DynaProperty. The reference equality test provided by Object is not useful in most cases. I have a patch and a new TestCase, but don't see a way to attach it on this form. I wasn't sure about the build number either. I got the source from anonymous svn. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-228) [beanutils] ConvertUtilsBean: register converter for specific property
[ http://issues.apache.org/jira/browse/BEANUTILS-228?page=all ] Niall Pemberton updated BEANUTILS-228: -- Bugzilla Id: (was: 31568) Component/s: Converters [beanutils] ConvertUtilsBean: register converter for specific property -- Key: BEANUTILS-228 URL: http://issues.apache.org/jira/browse/BEANUTILS-228 Project: Commons BeanUtils Issue Type: Improvement Components: Converters Affects Versions: 1.5 Environment: Operating System: other Platform: Other Reporter: Michael Schuerig Priority: Minor Currently, converters are selected only based on the class to which they convert objects. In general this works pretty well, but I've encountered cases, where this doesn't work out. For example, I'm using java.util.Date objects to represent points and intervals in time that are not completely specific, such as day of the week and month. Now I can easily write a Converter that uses SimpleDateFormat to convert string representations of these dates (Mon, Feb) to Date objects. When I register one of these converters with ConvertUtils(Bean), though, it preempts any conversion to Date. Something I clearly don't want as I have to deal with different kinds of dates. As a solution, I'd like to be able to register a converter for a specific property of a bean class, with a method this ConvertUtilsBean#register(Converter converter, java.lang.Class destinationClass, java.lang.Class beanClass, java.lang.String propertyName) Michael -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-227) [beanutils] Register converters by both target class and source class
[ http://issues.apache.org/jira/browse/BEANUTILS-227?page=all ] Niall Pemberton updated BEANUTILS-227: -- Bugzilla Id: (was: 20686) Component/s: Converters [beanutils] Register converters by both target class and source class - Key: BEANUTILS-227 URL: http://issues.apache.org/jira/browse/BEANUTILS-227 Project: Commons BeanUtils Issue Type: Improvement Components: Converters Environment: Operating System: All Platform: All Reporter: Eric Pabst Priority: Minor One of the big shortcomings I see with the ConvertUtils is that you can't intuitively register different converters based on source class. e.g. SomeClass to String, and OtherClass to String. Especially since multiple ConvertUtilsBeans can co-exist, it only makes sense to be able to get away from depending on the toString() method for ALL conversions to a String type (this is the nearest match that I can see to what I'm asking for). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-226) [beanutils] Instantiate property if null in form bean
[ http://issues.apache.org/jira/browse/BEANUTILS-226?page=all ] Niall Pemberton updated BEANUTILS-226: -- Bugzilla Id: (was: 10319) Component/s: Bean / Property Utils [beanutils] Instantiate property if null in form bean - Key: BEANUTILS-226 URL: http://issues.apache.org/jira/browse/BEANUTILS-226 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: other Platform: All Reporter: Emmanuel Boudrant Priority: Minor Attachments: auto-instantiate-smart-converters.txt, extensible-bean-utils.txt Hello, When nested property used inside a form bean, example : a class Date composed by 3 String. if the property is null, PropertyUtils.lookup return a null value. Is it possible to change this comportement by returning, if property is null, the property instanciated by default constructor, like the comportment of the jsp tag jsp:useBean ... Else I can't write/read the nested property date.day if date is null, Struts throw a exception. -Emmanuel -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-224) [beanutils] provide better error message for argument type mismatch
[ http://issues.apache.org/jira/browse/BEANUTILS-224?page=all ] Niall Pemberton updated BEANUTILS-224: -- Bugzilla Id: (was: 38165) Component/s: Bean / Property Utils [beanutils] provide better error message for argument type mismatch - Key: BEANUTILS-224 URL: http://issues.apache.org/jira/browse/BEANUTILS-224 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: All Platform: Other Reporter: Ralf Hauser Priority: Minor Fix For: 1.8.0 Attachments: PropertyUtilsBean.patch In Object org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(Method method, Object bean, Object[] values) throws IllegalAccessException, InvocationTargetException the throw block should rather be: throw new IllegalArgumentException( Cannot invoke + method.getDeclaringClass().getName() + . + method.getName() + - + e.getMessage() + - found + bean.getClass().getName()+ but expected + (values[0]).getClass().getName()); see also In Object org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(Method method, Object bean, Object[] values) throws IllegalAccessException, InvocationTargetException the throw block should rather be: throw new IllegalArgumentException( Cannot invoke + method.getDeclaringClass().getName() + . + method.getName() + - + e.getMessage() + - found + bean.getClass().getName()+ but expected + (values[0]).getClass().getName()); see also Bug 38163 for the context where this would have helped a lot. for the context where this would have helped a lot. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-223) [beanutils] Localizing beanutils
[ http://issues.apache.org/jira/browse/BEANUTILS-223?page=all ] Niall Pemberton updated BEANUTILS-223: -- Bugzilla Id: (was: 20836) Component/s: Converters [beanutils] Localizing beanutils Key: BEANUTILS-223 URL: http://issues.apache.org/jira/browse/BEANUTILS-223 Project: Commons BeanUtils Issue Type: Improvement Components: Converters Affects Versions: 1.6 Environment: Operating System: All Platform: All Reporter: José Tito C. Paiva Priority: Minor Attachments: BeanUtils.java, BigDecimalConverter.java Copy and converter funcions in bean utils aren't localized. I created a patch adding locale parameter to copyProperties/Property method. SQL Date converters were also modified. Now, when copying and converting properties, localized date and number formats are considered. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-221) [beanutils] add protected accessor to fundamental map in BeanUtils project
[ http://issues.apache.org/jira/browse/BEANUTILS-221?page=all ] Niall Pemberton updated BEANUTILS-221: -- Bugzilla Id: (was: 33384) Component/s: Bean / Property Utils [beanutils] add protected accessor to fundamental map in BeanUtils project -- Key: BEANUTILS-221 URL: http://issues.apache.org/jira/browse/BEANUTILS-221 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: All Platform: All Reporter: Marc DeXeT Priority: Minor In the maintime, it's impossible to extends major BeanUtils utils class ( as BeanUtilsBean, PropertyUtilsBean and so on) because of fundamental maps are private and there no protected access to them. It will be very nice for further enhancements to add protected accessor to them. Thanks ! -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-218) [beanutils] Need utility for collecting differences between objects
[ http://issues.apache.org/jira/browse/BEANUTILS-218?page=all ] Niall Pemberton updated BEANUTILS-218: -- Bugzilla Id: (was: 34470) Component/s: Bean / Property Utils [beanutils] Need utility for collecting differences between objects --- Key: BEANUTILS-218 URL: http://issues.apache.org/jira/browse/BEANUTILS-218 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: other Platform: Other Reporter: Nathan Egge Priority: Minor It would be really convinient if there was a method on the BeanUtils object that would return a list of all the attributes that have changed between two objects. This is useful for creating an audit trail of those attributes that have been modified. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-215) BeanUtilsBean: Set a mapped/indexed property, for example property(time)[0]
[ http://issues.apache.org/jira/browse/BEANUTILS-215?page=all ] Niall Pemberton updated BEANUTILS-215: -- Bugzilla Id: (was: 38722) Component/s: Expression Syntax BeanUtilsBean: Set a mapped/indexed property, for example property(time)[0] - Key: BEANUTILS-215 URL: http://issues.apache.org/jira/browse/BEANUTILS-215 Project: Commons BeanUtils Issue Type: Improvement Components: Expression Syntax Environment: Operating System: other Platform: Other Reporter: Ludwig Wensauer Priority: Minor From line 1014 ff there is the following piece of code: try { if (index = 0) { getPropertyUtils().setIndexedProperty(target, propName, index, newValue); } else if (key != null) { getPropertyUtils().setMappedProperty(target, propName, key, newValue); } else { getPropertyUtils().setProperty(target, propName, newValue); } ... That's good for mapped OR indexed properties, but unfortunatly i have both at the same time. So index is = 0 and key is also != null. My property-name looks like this one here: property(time)[0] -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-214) [beanutils] Preserving DynaBean Property Ordering
[ http://issues.apache.org/jira/browse/BEANUTILS-214?page=all ] Niall Pemberton updated BEANUTILS-214: -- Bugzilla Id: (was: 37825) Component/s: DynaBean [beanutils] Preserving DynaBean Property Ordering - Key: BEANUTILS-214 URL: http://issues.apache.org/jira/browse/BEANUTILS-214 Project: Commons BeanUtils Issue Type: Improvement Components: DynaBean Environment: Operating System: All Platform: All Reporter: Martin Fick Priority: Minor The order of properties is not preserved when using the beanutils to fetch properties from a DynaBean. Since DynaBeans use an array to define properties it is natural desire to use the order of this array to do things with a DynaBean. With a 2 line patch to BeanUtilsBean.java, it can be made to return a LinkedHashMap for DynaBean properties which preserves the ordering of these properties. This patch is particularly usefull if you are using the display tag to display DynaBeans. Several people have suggested a patch like this on the display tag mailing list. *** BeanUtilsBean.java --- BeanUtilsBean.java.ordered *** *** 26,31 --- 26,32 import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; + import java.util.LinkedHashMap; import java.util.Iterator; import java.util.Map; import java.util.WeakHashMap; *** *** 487,493 log.debug(Describing bean: + bean.getClass().getName()); } ! Map description = new HashMap(); if (bean instanceof DynaBean) { DynaProperty descriptors[] = ((DynaBean) bean).getDynaClass().getDynaProperties(); --- 488,494 log.debug(Describing bean: + bean.getClass().getName()); } ! Map description = new LinkedHashMap(); if (bean instanceof DynaBean) { DynaProperty descriptors[] = ((DynaBean) bean).getDynaClass().getDynaProperties(); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-213) [beanutils] Enhancement to ResultSetDynaClass to allow case-insensitive and missing parameter bean mapping
[ http://issues.apache.org/jira/browse/BEANUTILS-213?page=all ] Niall Pemberton updated BEANUTILS-213: -- Bugzilla Id: (was: 24185) Component/s: DynaBean [beanutils] Enhancement to ResultSetDynaClass to allow case-insensitive and missing parameter bean mapping -- Key: BEANUTILS-213 URL: http://issues.apache.org/jira/browse/BEANUTILS-213 Project: Commons BeanUtils Issue Type: Improvement Components: DynaBean Affects Versions: 1.6.1 Environment: Operating System: other Platform: Other Reporter: Michael Mainguy Priority: Minor Attachments: introspectClassJDBCDynaClass.patch, ResultSetDynaClass.java ##This is a 1 file patch for JDBCDynaClass and ResultSetDynaClass to allow more ##flexibility in the mapping of variable names to bean attributes. ##e.g. PROJNBR in resultset will automatically get mapped to ProjNbr or PrOjNbR ##in bean. class returned by iterator will not fail if there are fewer fields ##in resultset than in input bean. --- JDBCDynaClass.orig2003-10-14 11:40:20.0 -0400 +++ JDBCDynaClass.java2003-10-13 11:39:49.0 -0400 @@ -69,11 +69,13 @@ import java.util.HashMap; import java.util.Map; + /** * pProvides common logic for JDBC implementations of [EMAIL PROTECTED] DynaClass}./p * * @author Craig R. McClanahan * @author George Franciscus + * @author Michael Mainguy * @version $Revision: 1.3 $ $Date: 2003/10/09 20:43:15 $ */ @@ -256,6 +258,48 @@ } -} + /** + * pIntrospect the metadata associated with our result set, and populate + * the codeproperties/code and codepropertiesMap/code instance + * variables./p + * + * @param resultSet The coderesultSet/code whose metadata is to + * be introspected + * @param resultSet The codeDynaClass/code whose properties we want + * to use + * + * @exception SQLException if an error is encountered processing the + * result set metadata + * + */ + protected void introspect(ResultSet resultSet, DynaClass dynaClass) throws SQLException { + HashMap propmap = new HashMap(); + DynaProperty[] props = dynaClass.getDynaProperties(); + for (int i = 0; i props.length; i++) { + propmap.put(props[i].getName().toLowerCase(), props[i]); + + } + // Accumulate an ordered list of DynaProperties + ArrayList list = new ArrayList(); + ResultSetMetaData metadata = resultSet.getMetaData(); + int n = metadata.getColumnCount(); + for (int i = 1; i = n; i++) { // JDBC is one-relative! + DynaProperty dynaProperty = (DynaProperty)propmap.get (metadata.getColumnName(i).toLowerCase()); + if (dynaProperty != null) { + list.add(dynaProperty); + } + } + + // Convert this list into the internal data structures we need + properties = + (DynaProperty[]) list.toArray(new DynaProperty[list.size ()]); + for (int i = 0; i properties.length; i++) { + propertiesMap.put(properties[i].getName(), properties [i]); + } + + } + + +} --- ResultSetDynaClass.orig 2003-10-14 11:39:15.0 -0400 +++ ResultSetDynaClass.java 2003-10-13 11:39:47.0 -0400 @@ -123,145 +123,171 @@ * /pre * * @author Craig R. McClanahan + * @author Michael Mainguy * @version $Revision: 1.13 $ $Date: 2003/10/09 20:43:15 $ */ public class ResultSetDynaClass extends JDBCDynaClass implements DynaClass { - // --- Constructors +// --- Constructors - /** - * pConstruct a new ResultSetDynaClass for the specified - * codeResultSet/code. The property names corresponding - * to column names in the result set will be lower cased./p - * - * @param resultSet The result set to be wrapped - * - * @exception NullPointerException if coderesultSet/code - * is codenull/code - * @exception SQLException if the metadata for this result set - * cannot be introspected - */ - public ResultSetDynaClass(ResultSet resultSet) throws SQLException { - this(resultSet, true); - } +/** + * pConstruct a new ResultSetDynaClass for the specified + * codeResultSet/code. The property names corresponding + * to column names in the result set will be
[jira] Updated: (BEANUTILS-212) [beanutils] Generic implementations of toString, hashCode, equals() for DynaBean and DynaClass
[ http://issues.apache.org/jira/browse/BEANUTILS-212?page=all ] Niall Pemberton updated BEANUTILS-212: -- Bugzilla Id: (was: 32644) Component/s: DynaBean [beanutils] Generic implementations of toString, hashCode, equals() for DynaBean and DynaClass -- Key: BEANUTILS-212 URL: http://issues.apache.org/jira/browse/BEANUTILS-212 Project: Commons BeanUtils Issue Type: Improvement Components: DynaBean Affects Versions: Nightly Builds Environment: Operating System: All Platform: All Reporter: Kris Nuttycombe Priority: Minor Fix For: 1.8.0 Attachments: AbstractDynaBean.java, AbstractDynaClass.java, DynaUtils.java, patch.txt This patchset includes a new DynaUtils class containing builder methods for hash codes and string representations of DynaBeans and DynaClasses, abstract base classes for DynaBean and DynaClass that use DynaUtils to implement these methods, and patches for existing DynaBean and DynaClass implementations to make them extend these abstract base classes. Kris -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-211) [beanutils] Multiple mapped properties not possible / Direct maps and indexes not possible
[ http://issues.apache.org/jira/browse/BEANUTILS-211?page=all ] Niall Pemberton updated BEANUTILS-211: -- Bugzilla Id: (was: 15451) Component/s: Expression Syntax [beanutils] Multiple mapped properties not possible / Direct maps and indexes not possible -- Key: BEANUTILS-211 URL: http://issues.apache.org/jira/browse/BEANUTILS-211 Project: Commons BeanUtils Issue Type: Improvement Components: Expression Syntax Affects Versions: Nightly Builds Environment: Operating System: other Platform: All Reporter: Thomas Jacob Priority: Minor Fix For: 1.8.0 Within a property of any tag, it is not possible to map twice, such as property=customers(5)(3), or to map and index (property=customers(5)[3]. This is sometimes useful. Workarounds with bean:define are difficult, because the property tag is not able to map or index a Map or Collection directly, such as name=customers property=(3). This would be nice, too. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-210) [beanutils] copyProperties should have optional flag for including transient member variables
[ http://issues.apache.org/jira/browse/BEANUTILS-210?page=all ] Niall Pemberton updated BEANUTILS-210: -- Bugzilla Id: (was: 34644) Component/s: Bean / Property Utils [beanutils] copyProperties should have optional flag for including transient member variables - Key: BEANUTILS-210 URL: http://issues.apache.org/jira/browse/BEANUTILS-210 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: other Platform: Other Reporter: Nathan Egge Priority: Minor The EqualsBuilder, HashCodeBuilder, and ToStringBuilder all have a flag for allowing you to use only the non-transient member variables on an object. The BeanUtils.copyProperties method should have a similar such variable (which can default to false) so you can designate only some variables to copy across domains. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-209) [beanutils] Change propertyUtilsBean.findNextNestedIndex(String) modifier to protected ?
[ http://issues.apache.org/jira/browse/BEANUTILS-209?page=all ] Niall Pemberton updated BEANUTILS-209: -- Bugzilla Id: (was: 33342) Component/s: Expression Syntax [beanutils] Change propertyUtilsBean.findNextNestedIndex(String) modifier to protected ? Key: BEANUTILS-209 URL: http://issues.apache.org/jira/browse/BEANUTILS-209 Project: Commons BeanUtils Issue Type: Improvement Components: Expression Syntax Environment: Operating System: All Platform: All Reporter: Marc DeXeT Priority: Minor Could be be changed findNextNestedIndex modifier from private to protected ? It's to avoid to senselessly copy out this algo in custom PropertyUtilsBean subclasses to get exactly same feature. Thanks. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-208) [beanutils] MethodUtils: Need easy way to invoke static methods
[ http://issues.apache.org/jira/browse/BEANUTILS-208?page=all ] Niall Pemberton updated BEANUTILS-208: -- Bugzilla Id: (was: 20520) Component/s: Bean / Property Utils [beanutils] MethodUtils: Need easy way to invoke static methods --- Key: BEANUTILS-208 URL: http://issues.apache.org/jira/browse/BEANUTILS-208 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Affects Versions: Nightly Builds Environment: Operating System: other Platform: Other Reporter: analogue Priority: Minor May I suggest: public static Object invokeStaticMethod(Class clazz, String methodName, Class[] args); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-207) [beanutils][PATCH] Include bean getClass in PropertyUtilsBean Exceptions
[ http://issues.apache.org/jira/browse/BEANUTILS-207?page=all ] Niall Pemberton updated BEANUTILS-207: -- Bugzilla Id: (was: 20968) Component/s: Bean / Property Utils [beanutils][PATCH] Include bean getClass in PropertyUtilsBean Exceptions Key: BEANUTILS-207 URL: http://issues.apache.org/jira/browse/BEANUTILS-207 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: other Platform: Other Reporter: Erik Meade Priority: Minor Attachments: PropertyUtilsBeanIncludeBeanClassnameInExceptions.txt It would make debugging a lot easier. The bean is already in the method, it is just a matter of adding bean.getClass() in the creation of the error messages. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-206) Check registered Converters for super classes if not found
[ http://issues.apache.org/jira/browse/BEANUTILS-206?page=all ] Niall Pemberton updated BEANUTILS-206: -- Bugzilla Id: (was: 20027) Component/s: Converters Summary: Check registered Converters for super classes if not found (was: [beanutils] ConvertUtils enhancements) Check registered Converters for super classes if not found -- Key: BEANUTILS-206 URL: http://issues.apache.org/jira/browse/BEANUTILS-206 Project: Commons BeanUtils Issue Type: Improvement Components: Converters Environment: Operating System: other Platform: Other Reporter: ittay Priority: Minor 1. add the ability to register other converters 2. if no converter is registered for a class, check if there is a converter for one of its super classes. if not, try to find if the class has a conversion method (e.g., convert(String)) thanx, ittay -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-204) [beanutils] LocaleBeanUtils.copyProperties() does not use Locale aware converions
[ http://issues.apache.org/jira/browse/BEANUTILS-204?page=all ] Niall Pemberton updated BEANUTILS-204: -- Bugzilla Id: (was: 16038) Component/s: Localized Converters [beanutils] LocaleBeanUtils.copyProperties() does not use Locale aware converions - Key: BEANUTILS-204 URL: http://issues.apache.org/jira/browse/BEANUTILS-204 Project: Commons BeanUtils Issue Type: Improvement Components: Locale BeanUtils / Converters Affects Versions: 1.5 Environment: Operating System: other Platform: Other Reporter: Robert Burrell Donkin Priority: Minor Fix For: 1.8.0 for more details see http://marc.theaimsgroup.com/?l=jakarta-commons-userm=104239393332710w=2 this functionality would be a little tricky to add and can wait until after the 1.6 release. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-202) [beanutils] proposed new method contains for BeanUtils
[ http://issues.apache.org/jira/browse/BEANUTILS-202?page=all ] Niall Pemberton updated BEANUTILS-202: -- Bugzilla Id: (was: 32103) Component/s: Bean / Property Utils [beanutils] proposed new method contains for BeanUtils Key: BEANUTILS-202 URL: http://issues.apache.org/jira/browse/BEANUTILS-202 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Affects Versions: 1.7.0 Environment: Operating System: other Platform: Other Reporter: Corey Scott Priority: Minor Attachments: beanUtils_contains.txt I have found myself wanting to check for the existance of properties in a bean and several occasions. Attached is a patch that would add this functionality. Thanks, Corey -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-201) [beanutils] Proposition for controlled copy of bean properties
[ http://issues.apache.org/jira/browse/BEANUTILS-201?page=all ] Niall Pemberton updated BEANUTILS-201: -- Bugzilla Id: (was: 37987) Component/s: Bean / Property Utils [beanutils] Proposition for controlled copy of bean properties Key: BEANUTILS-201 URL: http://issues.apache.org/jira/browse/BEANUTILS-201 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: All Platform: Other Reporter: adelino Priority: Minor IN SHORT This request is about adding to the BeanUtils class a new method: copyProperties(Object target, Object src, Class editable) ... that copies 'src' to 'target' as if they were declared as instances of 'editable'. See sections below for more details. This request is to some extent related to the enhancement 32642. PROBLEM DESCRIPTION Today Commons BeanUtils offers the possibility to copy properties between 2 java beans: static void copyProperties(Object dest, Object orig) As the instrospection does not care about how the target variable was declared, calling such a method will copy more properties that one wants. To illustrate this point, let's consider the following types: interface EditablePriceableItem { public int getPrice(); public void setPrice(int val); } class PurchaseItem implements EditablePriceableItem { //... attributes public String getPurchaseNr() { ... } public void setPurchaseNr(String nr) { ... } public int getPrice() { ... } ; public void setPrice(int val) { ... }; } class Project implements EditablePriceableItem { //... attributes public String getDescription() { ... } public void setDescription(String desc) { ... } public int getPrice() { ... } ; public void setPrice(int val) { ... }; } Somewhere in a class, we have: EditablePriceableItem priceableSrc; EditablePriceableItem priceableTarget; //(1) // ... // priceableSrc is set by some method // ... // //(2) // priceableTarget gets instanciated // ... //(3) //Now I want to copy Priceable properties (and only priceable properties !) //from priceableSrc to priceableTarget BeanUtils.copyProperties(priceableTarget,priceableSrc); Although variables are declared as EditablePriceableItem, what gets copied in (3) depends on the concrete type of priceableSrc and priceableTarget. a) When priceableSrc and priceableTarget are instances of PurchaseItem, price and purchaseNr are copied b) When priceableSrc and priceableTarget are instances of Project, price and description are copied c) When priceableSrc is an instance of PurchaseItem and priceableTarget is an instance of Project (or the opposite) only price gets copied As a conclusion the behaviour in (3) is not uniform. PROPOSITION To control the scope of properties that are copied, it would be very useful to have a method such as: static void copyProperties(Object target, Object source, Class editableScope) where editableScope is an interface or class that declares the properties. Writing (3) as: BeanUtils.copyProperties(priceableTarget,priceableSrc, EditablePriceableItem.class); would provide a consistent behaviour. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-200) [beanutils] Need a BeanUtils.describeRaw method
[ http://issues.apache.org/jira/browse/BEANUTILS-200?page=all ] Niall Pemberton updated BEANUTILS-200: -- Bugzilla Id: (was: 34523) Component/s: Bean / Property Utils [beanutils] Need a BeanUtils.describeRaw method --- Key: BEANUTILS-200 URL: http://issues.apache.org/jira/browse/BEANUTILS-200 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: other Platform: Other Reporter: Nathan Egge Priority: Minor Attachments: patch, patch Similar to the issue I submitted here: http://issues.apache.org/bugzilla/show_bug.cgi?id=34470 It woudld be nice to have a method on BeanUtils that would return a Map that just contains the values from the bean. That is, the proposed method describeRaw would simply iterate over all readable methods (ones that look like get*) and return a Map where the key is the name of the attribute and the value is the Object that calling get* returns. Having this method would make it easy to create generic code that pulls values out of objects and creates an audit trail using AOP constructs. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-199) [beanutils] BeanUtils.setProperty is over-zealous at converting types
[ http://issues.apache.org/jira/browse/BEANUTILS-199?page=all ] Niall Pemberton updated BEANUTILS-199: -- Bugzilla Id: (was: 16525) Component/s: Converters [beanutils] BeanUtils.setProperty is over-zealous at converting types - Key: BEANUTILS-199 URL: http://issues.apache.org/jira/browse/BEANUTILS-199 Project: Commons BeanUtils Issue Type: Improvement Components: Converters Affects Versions: 1.6 Environment: Operating System: All Platform: All Reporter: Tim Vernum Priority: Minor Fix For: 1.8.0 Attachments: BeanUtils-invalid-conversion.patch, copyProperty_extended.patch, Test.java, Test.java As of Release 1.6, BeanUtils.setProperty goes to great lengths to convert types into Strings and then from Strings into valid target types, without ever considering whether the original value was valid to start with. e.g: setProperty( bean, object, new Integer(77) ) ; will set the object in the bean to the String 77. when what is intended is to set it to an Integer. copyProperty gets it right, but it doesn't understand nested properties, so it isn't useful for my situation. PropertyUtils does a better job, but it doesn't do *any* conversions, so it breaks in other situations. There doesn't seem to be a reasonable way to say: set nested/indexed/mapped property 'X' in this bean to be value 'Y', and do whatever conversions are necessary to get it there The options seem to be: set simple property X to value Y with proper conversions (BeanUtils.copyProperty) set complex property X to value Y with too many conversions (BeanUtils.setProperty) set complex property X to value Y with no conversions (PropertyUtils.setProperty) Is BeanUtils.setProperty wrong? Or do we need another method that set complex properties using the same conversion methds as copyProperty ? I have a patch (which I'll attach) which makes setProperty do something closer to what I think it should do, but I'm not sure if that's the correct approach. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-198) [beanutils] Copy bean properties with different names
[ http://issues.apache.org/jira/browse/BEANUTILS-198?page=all ] Niall Pemberton updated BEANUTILS-198: -- Bugzilla Id: (was: 33109) Component/s: Bean / Property Utils [beanutils] Copy bean properties with different names - Key: BEANUTILS-198 URL: http://issues.apache.org/jira/browse/BEANUTILS-198 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Affects Versions: Nightly Builds Environment: Operating System: All Platform: PC Reporter: Rafael U. C. Afonso Priority: Minor Attachments: BeanFrom.java, BeanTo.java, CopyPropertiesWithDifferentNames.java In avaliable BeanUtils.copyProperties() implementation it is necessary that properties names of origin and destiny bean must be equals. My propose is include a overloading method in BeanUtils that receives - beyond destiny and origin beans - a two dimensional String array with two columns. This array will have name of properties to be copied - destiny property in first column, origin property in second column. Code Implementation: private static final int TO = 0; private static final int FROM = 1; /**pCopy property values from the origin bean to the destination bean * for cases where properties names are different. A bidimentional array * provides properties names: destiny bean properties in first column and * origin bean properties in secon column. To be added to * org.apache.commons.beanutils.BeanUtils class. * * @param dest * @param orig * @param toFrom * @throws IllegalAccessException * @throws InvocationTargetException * @throws NoSuchMethodException */ public static void copyProperties(Object dest, Object orig, String[][] toFrom) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { BeanUtilsBean beanUtilsBean = BeanUtilsBean.getInstance(); for (int i = 0; i toFrom.length; i++) { String[] strings = toFrom[i]; Object value = beanUtilsBean.getProperty(orig, strings[FROM]); beanUtilsBean.setProperty(dest, strings[TO], value); } } Usage: BeanFrom from = new BeanFrom(10, my value); // properties: keyFrom (int), valueFrom (String) BeanTo to = new BeanTo(); // properties: keyTo (int), valueTo (String) String[][] table = { { keyTo, keyFrom }, { valueTo, valueFrom } }; copyProperties(b, a, table); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-197) [beanutils] Copy Specific Properties
[ http://issues.apache.org/jira/browse/BEANUTILS-197?page=all ] Niall Pemberton updated BEANUTILS-197: -- Bugzilla Id: (was: 32642) Component/s: Bean / Property Utils [beanutils] Copy Specific Properties Key: BEANUTILS-197 URL: http://issues.apache.org/jira/browse/BEANUTILS-197 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: All Platform: All Reporter: Charlie Jones Priority: Minor In building an application my team came across a need to copy specific properties only. I realize this is a trivial enhancement however it would save others who find the same need from coding a solution themselves. Below is an implementation ( The one we used ). Code- public static void copyProperties(Object to, Object from, String[] properties) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { for (int idx = 0; idx properties.length; idx++) { copyProperty( to, propertyNames[i], getPropertyUtils().getProperty( from, propertyNames[i])); } } -Code--- -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-196) [beanutils] StringArrayConverter does not handle double[] input
[ http://issues.apache.org/jira/browse/BEANUTILS-196?page=all ] Niall Pemberton updated BEANUTILS-196: -- Bugzilla Id: (was: 33698) Component/s: Converters [beanutils] StringArrayConverter does not handle double[] input --- Key: BEANUTILS-196 URL: http://issues.apache.org/jira/browse/BEANUTILS-196 Project: Commons BeanUtils Issue Type: Improvement Components: Converters Environment: Operating System: All Platform: All Reporter: Clark E. Archer Priority: Minor Attachments: patch-StringArrayConverter.txt, patch-StringArrayConverterTestCase.txt StringArrayConverter currently handles only int[] and String[] input specifically; all other arrays are parsed as a String. I'd like to have StringArrayConverter support double[] input values. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-193) [beanutils] MethodUtils.invoke for static methods
[ http://issues.apache.org/jira/browse/BEANUTILS-193?page=all ] Niall Pemberton updated BEANUTILS-193: -- Bugzilla Id: (was: 33979) Component/s: Bean / Property Utils [beanutils] MethodUtils.invoke for static methods - Key: BEANUTILS-193 URL: http://issues.apache.org/jira/browse/BEANUTILS-193 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Affects Versions: 1.6 Environment: Operating System: Windows XP Platform: PC Reporter: Nestor Boscan Priority: Minor Attachments: MethodUtils.java I modified the MethodUtils class and added 6 new methods to invoke static methods. invokeExactMethod (Class, String, Object []) invokeExactMethod (Class, String, Object [], Class []) invokeExactMethod (Class, String, Object) invokeMethod (Class, String, Object []) invokeMethod (Class, String, Object [], Class []) invokeMethod (Class, String, Object) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-189) [beanutils] copyProperties method should not exit as soon as it gets Exception
[ http://issues.apache.org/jira/browse/BEANUTILS-189?page=all ] Niall Pemberton updated BEANUTILS-189: -- Bugzilla Id: (was: 21693) Component/s: Bean / Property Utils [beanutils] copyProperties method should not exit as soon as it gets Exception -- Key: BEANUTILS-189 URL: http://issues.apache.org/jira/browse/BEANUTILS-189 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Affects Versions: Nightly Builds Environment: Operating System: All Platform: All Reporter: Ian Howlett Priority: Minor The copyProperties method in BeanUtils.java currently has trouble with EJBs because it exits as soon as an Exception is raised (often a java.lang.reflect.InvocationTargetException). Rather than exiting the method and throwing the Exception to the caller, the method should give a choice to swallow the exception for this field and move on to attempting the next field. This is trivial at the coding stage, requiring just a try/catch block inside the 'for' loop. Perhaps more tricky is designing the API to cope with this behavior whilst retaining backwards compatibility. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-188) [beanutils] add collection modifiers feature to PropertyUtilsBean
[ http://issues.apache.org/jira/browse/BEANUTILS-188?page=all ] Niall Pemberton updated BEANUTILS-188: -- Bugzilla Id: (was: 33352) Component/s: Bean / Property Utils [beanutils] add collection modifiers feature to PropertyUtilsBean - Key: BEANUTILS-188 URL: http://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 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-187) [beanutils] Methods ConvertUtilsBean.convert could check for converters registered with base classes
[ http://issues.apache.org/jira/browse/BEANUTILS-187?page=all ] Niall Pemberton updated BEANUTILS-187: -- Bugzilla Id: (was: 19857) Component/s: Converters [beanutils] Methods ConvertUtilsBean.convert could check for converters registered with base classes Key: BEANUTILS-187 URL: http://issues.apache.org/jira/browse/BEANUTILS-187 Project: Commons BeanUtils Issue Type: Improvement Components: Converters Environment: Operating System: other Platform: Other Reporter: Alexander Borschet Priority: Minor When converting a value to a class instance it is possible tu register user defined classes that implement the converter interface. The method convert(String value, Class clazz) in ConvertUtilsBean tries to get an instance of a converter class simply by checking the collection of registered converters. Unfortunately converters that have been registered for super classes are not considered. REQUEST: How about improving the method convert by the following code lines: Class baseclazz = clazz; Converter converter = null; do { converter = (Converter) converters.get(baseclazz); if (converter != null) break; baseclazz = clazz.getSuperclass(); } while (baseclazz != null); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-185) [beanutils] Try to align BeanUtils with JSTL standard tags
[ http://issues.apache.org/jira/browse/BEANUTILS-185?page=all ] Niall Pemberton updated BEANUTILS-185: -- Bugzilla Id: (was: 39504) Component/s: DynaBean [beanutils] Try to align BeanUtils with JSTL standard tags -- Key: BEANUTILS-185 URL: http://issues.apache.org/jira/browse/BEANUTILS-185 Project: Commons BeanUtils Issue Type: Improvement Components: DynaBean Environment: Operating System: other Platform: Other Reporter: Gabriel Belingueres Priority: Minor 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-183) [beanutils] Problem with index property
[ http://issues.apache.org/jira/browse/BEANUTILS-183?page=all ] Niall Pemberton updated BEANUTILS-183: -- Bugzilla Id: (was: 17002) Component/s: Bean / Property Utils [beanutils] Problem with index property --- Key: BEANUTILS-183 URL: http://issues.apache.org/jira/browse/BEANUTILS-183 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: All Platform: PC Reporter: Laura Misciagna Priority: Minor I have changed the PropertyUtils in the public static void setIndexedProperty (Object bean, String name, int index, Object value)method I have added the following code because I have a null pointer exception the array is null. if (array != null) // CODE ADDED if(!array.getClass().isArray()){ if(array instanceof List) ((List)array).set(index, value); else throw new IllegalArgumentException(Property ' + name + ' is not indexed); } else {Array.set(array, index, value);} Now I try to explain because I have this exception, I have a Form Bean A with a property that is an array in this array are stored the index of selected row in the table so when the rows are selected if I go to another form bean B by using a forward to another action mapping. Also this new bean has the same property of A but the array is not initialized and of couse will have different size. So when Struts tries to populate the form bean B found the parm in the request and try to initialize the property of B (but in my case is wrong) so it has a null pointer exception. If I add the check if the array is null the problem is solved. Could you ask me if you want introduce my fix in your code. The version of Struts tah I use it is that shipped with WSAD v. 5. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-182) [beanutils] Dynabeans are not cloneable
[ http://issues.apache.org/jira/browse/BEANUTILS-182?page=all ] Niall Pemberton updated BEANUTILS-182: -- Bugzilla Id: (was: 36592) Component/s: DynaBean [beanutils] Dynabeans are not cloneable --- Key: BEANUTILS-182 URL: http://issues.apache.org/jira/browse/BEANUTILS-182 Project: Commons BeanUtils Issue Type: Improvement Components: DynaBean Environment: Operating System: All Platform: All Reporter: Jérôme Beau Priority: Minor Currently, calling clone() on any DynaBean implementation raises a CloneNotSupportedException. As property holders, it would be convenient that DynaBeans support be Cloneable. A usage example of such cloneability is the need for memorizing previous bean's states, either for logging or transactional (memory rollback) purposes. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-181) [beanutils] Default converter for LocaleConvertUtilsBean
[ http://issues.apache.org/jira/browse/BEANUTILS-181?page=all ] Niall Pemberton updated BEANUTILS-181: -- Bugzilla Id: (was: 30941) Component/s: Locale BeanUtils / Converters [beanutils] Default converter for LocaleConvertUtilsBean Key: BEANUTILS-181 URL: http://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 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-179) [beanutils] BeanUtils could use a premade ISO8601 date converter
[ http://issues.apache.org/jira/browse/BEANUTILS-179?page=all ] Niall Pemberton updated BEANUTILS-179: -- Bugzilla Id: (was: 38772) Component/s: Converters [beanutils] BeanUtils could use a premade ISO8601 date converter Key: BEANUTILS-179 URL: http://issues.apache.org/jira/browse/BEANUTILS-179 Project: Commons BeanUtils Issue Type: Improvement Components: Converters Environment: Operating System: other Platform: Other Reporter: Jonathan Fuerth Priority: Minor Attachments: ISO8601DateConverter.java, ISO8601DateConverterTest.java This is a standard date format that doesn't depend on the JVM's default locale, so it would make sense to support it in the standard BeanUtils distribution. See http://www.w3.org/TR/NOTE-datetime for details. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-178) [beanutils] New implementation in commons-beanutils
[ http://issues.apache.org/jira/browse/BEANUTILS-178?page=all ] Niall Pemberton updated BEANUTILS-178: -- Bugzilla Id: (was: 31197) Component/s: DynaBean [beanutils] New implementation in commons-beanutils --- Key: BEANUTILS-178 URL: http://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 typing... -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-177) [beanutils] Add dynamic discovery of mapped properties to PropertyUtils
[ http://issues.apache.org/jira/browse/BEANUTILS-177?page=all ] Niall Pemberton updated BEANUTILS-177: -- Bugzilla Id: (was: 17501) Component/s: Bean / Property Utils [beanutils] Add dynamic discovery of mapped properties to PropertyUtils --- Key: BEANUTILS-177 URL: http://issues.apache.org/jira/browse/BEANUTILS-177 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Affects Versions: 1.6 Environment: Operating System: All Platform: All Reporter: Kris Schneider Priority: Minor I had thought that the getMappedPropertyDescriptors method would dynamically discover the mapped properties of a given bean (as the getPropertyDescriptors method does for simple and indexed properties), but it looks like all it does is return a map of cached descriptors. It also looks like the only place entries are added to that cache is in the getPropertyDescriptor method. Which means you have to know the name of the mapped property ahead of time. It would be nice for PropertyUtils to provide a method that returns an array of MappedPropertyDescriptor for a given bean. As an example, here's a couple of utility methods I'm currently using: public static MappedPropertyDescriptor[] getMappedPropertyDescriptors(Object bean) { if (bean == null) { throw new NullPointerException(No bean specified); } return (getMappedPropertyDescriptors(bean.getClass())); } public static MappedPropertyDescriptor[] getMappedPropertyDescriptors(Class beanClass) { if (beanClass == null) { throw new NullPointerException(No bean class specified); } Method[] allMethods = beanClass.getMethods(); Map descriptorMap = new HashMap(); for (int i = 0, n = allMethods.length; i n; i++) { String methodName = allMethods[i].getName(); if ((methodName.startsWith(get)) || (methodName.startsWith(set))) { String propName = Introspector.decapitalize(methodName.substring(3)); if ((propName.length() 0) (descriptorMap.get(propName) == null)) { try { MappedPropertyDescriptor descriptor = new MappedPropertyDescriptor(propName, beanClass); descriptorMap.put(propName, descriptor); } catch (IntrospectionException ignore) {} } } } MappedPropertyDescriptor[] descriptors = null; int numDescriptors = descriptorMap.size(); if (numDescriptors 0) { descriptors = new MappedPropertyDescriptor[numDescriptors]; Iterator iter = descriptorMap.values().iterator(); int i = 0; while (iter.hasNext()) { descriptors[i++] = (MappedPropertyDescriptor)iter.next(); } } if (descriptors == null) { descriptors = new MappedPropertyDescriptor[0]; } return descriptors; } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-176) [beanutils]: Exception if property doesn't exist in BeanUtilsBean.setProperty()
[ http://issues.apache.org/jira/browse/BEANUTILS-176?page=all ] Niall Pemberton updated BEANUTILS-176: -- Bugzilla Id: (was: 31095) Component/s: Bean / Property Utils [beanutils]: Exception if property doesn't exist in BeanUtilsBean.setProperty() --- Key: BEANUTILS-176 URL: http://issues.apache.org/jira/browse/BEANUTILS-176 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: other Platform: Other Reporter: Lars Beuster Priority: Minor I'd like a have an exception thrown if I use BeanUilsBean.setProperty()/populate()/... with an invalid property name, so that I can see immediately if I've done something wrong. An optional boolean parameter for these methods would be nice. Thanks Lars -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - 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
[ http://issues.apache.org/jira/browse/BEANUTILS-175?page=all ] Niall Pemberton updated BEANUTILS-175: -- Bugzilla Id: (was: 20549) Component/s: Bean / Property Utils [beanutils] Handling of exceptions thrown during BeanUtils.populate --- Key: BEANUTILS-175 URL: http://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 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-172) [beanutils] BeanUtils and PropertyUtils toString function (code included)
[ http://issues.apache.org/jira/browse/BEANUTILS-172?page=all ] Niall Pemberton updated BEANUTILS-172: -- Bugzilla Id: (was: 21483) Component/s: Bean / Property Utils [beanutils] BeanUtils and PropertyUtils toString function (code included) - Key: BEANUTILS-172 URL: http://issues.apache.org/jira/browse/BEANUTILS-172 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: All Platform: All Reporter: Ryan Barker Priority: Minor Fix For: 1.8.0 Attachments: BeanToStringBuilder.java I thought it would be nice if there was an easy way to have a toString function that would take a bean and output a string, as writing toString functions for the BeanUtils class gets old fast. So I went and wrote one based off the toString function for org.apache.struts.action.DynaActionForm. The following function will output the contents of a bean in a very verbose manner. I would suggest that this version is suitable for PropertyUtils, while a BeanUtils version would not have the code blocks for the verbose List, Array and Map strings. This code uses recursion to handle nested beans. Feel free to email me regarding this code // Code Start public static String toString(Object value) { if (value == null) { return NULL; } StringBuffer sb = new StringBuffer(); if (value.getClass().isArray()) { // verbose array output int n = Array.getLength(value); sb.append({); for (int j = 0; j n; j++) { if (j 0) { sb.append(','); } sb.append(toString(Array.get(value, j))); } sb.append(}); } else if (value instanceof List) { // verbose list output int n = ((List) value).size(); sb.append({); for (Iterator j=((List) value).iterator(); j.hasNext(); ) { sb.append(toString(j.next())); if (j.hasNext()) { sb.append(','); } } sb.append(}); } else if (value instanceof Map) { // verbose map output Iterator j = ((Map) value).entrySet().iterator(); sb.append({); while (j.hasNext()) { Map.Entry e = (Map.Entry) j.next(); sb.append(e.getKey()); sb.append('='); sb.append(toString(e.getValue())); if (j.hasNext()) { sb.append(','); } } sb.append(}); } else if (ConvertUtils.lookup(value.getClass()) != null) { // use the convertutils for this parameter sb.append(ConvertUtils.convert(value)); } else { // check if this class has a toString method declared anywhere for it Method toStringMethod = MethodUtils.getAccessibleMethod(value.getClass(),toString,new Class [0]); if (toStringMethod == null || toStringMethod.getDeclaringClass().getName().equals(java.lang.Object)) { // its a bean! sb.append([className=); sb.append(value.getClass().getName()); // find its properties Map props = null; try { props = PropertyUtils.describe(value); } catch (Exception e) { sb.append(EXCEPTION); } // and print them if (props != null) { for (Iterator i=props.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); Object entryValue = entry.getValue(); // dont print the class name twice if (!(entryValue instanceof Class)) { sb.append(','); sb.append(entry.getKey()); sb.append('='); sb.append(toString(entry.getValue())); } } } sb.append(]); } else { // use the normal toString method sb.append(value.toString()); } } return (sb.toString()); } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-171) [beanutils] Nested Bean Collection
[ http://issues.apache.org/jira/browse/BEANUTILS-171?page=all ] Niall Pemberton updated BEANUTILS-171: -- Bugzilla Id: (was: 7226) Component/s: Expression Syntax [beanutils] Nested Bean Collection -- Key: BEANUTILS-171 URL: http://issues.apache.org/jira/browse/BEANUTILS-171 Project: Commons BeanUtils Issue Type: Improvement Components: Expression Syntax Affects Versions: 1.1 Environment: Operating System: All Platform: All Reporter: scott sadlo Priority: Minor Fix For: 1.8.0 I work for a company currently using struts. Struts relies upon Commons Bean Utilities. My enhancement involves the setting of values in Collection properties of a bean. In struts, i create an HTML input element with the name syntax property_of_the_bean[0] where [0] indicates which element of the collection will have its setProperty_of_the_bean() method called. The issue is with nested Collections. I would like to be able to set my HTML input element name to match the form property_of_the_bean[x][y] so that the setProperty_of_the_bean() method of the Yth bean of the collection from the Xth bean of the last parent's collection will be called. Can you please respond to my inquiry stating your understanding of my wishes and any possible suggestions for action? Thank You. Sincerely, sjs -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-168) [beanutils] copyProperties(List, List) does not work - pls warn about this
[ http://issues.apache.org/jira/browse/BEANUTILS-168?page=all ] Niall Pemberton updated BEANUTILS-168: -- Bugzilla Id: (was: 33176) Component/s: Bean / Property Utils [beanutils] copyProperties(List, List) does not work - pls warn about this -- Key: BEANUTILS-168 URL: http://issues.apache.org/jira/browse/BEANUTILS-168 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Environment: Operating System: All Platform: PC Reporter: Ralf Hauser Priority: Minor my application tries to copy a list. List workerList = new ArrayList(); BeanUtils.copyProperties(workerList, msg.getAllRecip()); the size of the ArrayList allRecip in my msg object is 6. After the copy, the size of the workerList remains 0. Sure, workerList.addAll(msg.getAllRecip()); works as an alternative, but wouldn't it be appropriate to warn the user of copyProperties ? Might be related to COM-343 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-167) [beanutils] Get Method based on method description
[ http://issues.apache.org/jira/browse/BEANUTILS-167?page=all ] Niall Pemberton updated BEANUTILS-167: -- Bugzilla Id: (was: 33980) Component/s: Bean / Property Utils [beanutils] Get Method based on method description -- Key: BEANUTILS-167 URL: http://issues.apache.org/jira/browse/BEANUTILS-167 Project: Commons BeanUtils Issue Type: Improvement Components: Bean / Property Utils Affects Versions: 1.6 Environment: Operating System: Windows XP Platform: PC Reporter: Nestor Boscan Priority: Minor Attachments: getmethod.txt Add getMethod (String methodDescription) method to get a Method object based on a method description (Ex: double Math.abs (double), java.lang.String.concat (java.lang.String), java.util.Arrays.binarySearch (double [], double). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-163) [beanutils] MappedPropertyDescriptor broken
[ http://issues.apache.org/jira/browse/BEANUTILS-163?page=all ] Niall Pemberton updated BEANUTILS-163: -- Bugzilla Id: (was: 23383) Component/s: Bean / Property Utils [beanutils] MappedPropertyDescriptor broken --- Key: BEANUTILS-163 URL: http://issues.apache.org/jira/browse/BEANUTILS-163 Project: Commons BeanUtils Issue Type: Bug Components: Bean / Property Utils Environment: Operating System: All Platform: All Reporter: Daniel Spilker When trying to create a MappedPropertyDescriptor for a mapped property with an invalid setter method, an IntrospectionException is thrown. E.g. I have a class with the methods: getProperty(String):Property setProperty(String, Value):void Since MappedPropertyDescriptor#findMethod(Class, String, int, Class[]) returns that invalid setter method MappedPropertyDescriptor#findMappedPropertyType fails. It would be nice for MappedPropertyDescriptor to ignore invalid setter methods. After some debugging I found that MappedPropertyDescriptor#internalFindMethod(Class, String, int, Class[]) calls MappedPropertyDescriptor#internalFindMethod(Class, String, int) for the class' interfaces. So it misses the parameter which specifies the method's argument classes. I think the way it's meant to be is to use MappedPropertyDescriptor#internalFindMethod(Class, String, int, Class[]) for that call, too. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-157) [beanutils] 1.6.1 cannot determine reader methods for anonymous class
[ http://issues.apache.org/jira/browse/BEANUTILS-157?page=all ] Niall Pemberton updated BEANUTILS-157: -- Bugzilla Id: (was: 33461) Component/s: Bean / Property Utils [beanutils] 1.6.1 cannot determine reader methods for anonymous class - Key: BEANUTILS-157 URL: http://issues.apache.org/jira/browse/BEANUTILS-157 Project: Commons BeanUtils Issue Type: Bug Components: Bean / Property Utils Environment: Operating System: Windows XP Platform: PC Reporter: Thorbjørn Ravn Andersen I have the following snippet in a JSP-page which uses BeanUtils 1.6.1 and I get an exception. Code snippet (the anonymous class is to get a JavaBean defined in the JSP-page): --- List l = new ArrayList(); for(int i = 1; i 10; i++) { final int i2 = i; Object o = new Serializable() { String x = + i2; String y = + (100+i2) ; public String getX() { return x; } public String getY() { return y; } public String toString() { return getX() + + getY(); } }; l.add(o); Map map = BeanUtils.describe(o); --- which gives me the following exception: --- javax.servlet.ServletException: Property 'y' has no getter method at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825) at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758) at org.apache.jsp.main_jsp._jspService(main_jsp.java:257) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) at com.transaxiom.axsWHSweb.servlet.GetCurrentStock.doPost(GetCurrentStock.java:31) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at
[jira] Updated: (BEANUTILS-156) [beanutils] Memory leak on webapp undeploy in MappedPropertyDescriptor
[ http://issues.apache.org/jira/browse/BEANUTILS-156?page=all ] Niall Pemberton updated BEANUTILS-156: -- Bugzilla Id: (was: 35262) Component/s: Bean / Property Utils [beanutils] Memory leak on webapp undeploy in MappedPropertyDescriptor -- Key: BEANUTILS-156 URL: http://issues.apache.org/jira/browse/BEANUTILS-156 Project: Commons BeanUtils Issue Type: Bug Components: Bean / Property Utils Affects Versions: 1.6 Environment: Operating System: All Platform: All Reporter: Simon Kitching Class MappedPropertyDescriptor has a Hashtable declaredMethodCache containing a mapping from Class to Method[]. 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-142) [beanutils] RowSetDynaClass fails to copy resulset to DynaBean with Oracle 10g JDBC driver
[ http://issues.apache.org/jira/browse/BEANUTILS-142?page=all ] Niall Pemberton updated BEANUTILS-142: -- Bugzilla Id: (was: 39343) Component/s: DynaBean [beanutils] RowSetDynaClass fails to copy resulset to DynaBean with Oracle 10g JDBC driver -- Key: BEANUTILS-142 URL: http://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 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. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-140) [beanutils] LocaleBeanUtils setProperty does not work on nested property
[ http://issues.apache.org/jira/browse/BEANUTILS-140?page=all ] Niall Pemberton updated BEANUTILS-140: -- Bugzilla Id: (was: 30203) Component/s: Locale BeanUtils / Converters [beanutils] LocaleBeanUtils setProperty does not work on nested property Key: BEANUTILS-140 URL: http://issues.apache.org/jira/browse/BEANUTILS-140 Project: Commons BeanUtils Issue Type: Bug Components: Locale BeanUtils / Converters Environment: Operating System: All Platform: All Reporter: Marco La Porta LocaleBeanUtils setProperty does not work on nested property. I think the problem is in the method definePropertyType(Object target, String name, String propName). When property is a nested property (prop1.propnested) target is the result of a call of the prop1 getter on the oroginal bean, name is the property name complete (prop1.propnested) and propName is the property name in target object (propnested). At line 601 the property descriptor is defined as descriptor = PropertyUtils.getPropertyDescriptor(target, name); and in case of nested propery it is never found (null) I think the correct line 601 is descriptor = PropertyUtils.getPropertyDescriptor(target, propName); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-134) [beanutils] Call to toString() in should be replaced with getConvertUtils().convert(value)
[ http://issues.apache.org/jira/browse/BEANUTILS-134?page=all ] Niall Pemberton updated BEANUTILS-134: -- Bugzilla Id: (was: 32162) Component/s: Converters [beanutils] Call to toString() in should be replaced with getConvertUtils().convert(value) -- Key: BEANUTILS-134 URL: http://issues.apache.org/jira/browse/BEANUTILS-134 Project: Commons BeanUtils Issue Type: Bug Components: Converters Affects Versions: Nightly Builds Environment: Operating System: other Platform: Other Reporter: Etienne Bernard Fix For: 1.8.0 In BeanUtilsBean#getArrayProperty(Object, String) line 577 (in the CVS version), we should have: results[0] = getConvertUtils().convert(value); instead of: results[0] = value.toString(); Rationale: the struts html taglibs doesn't work correctly with my objects with the correct Converters registered. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-113) [beanutils] Indexed property inside a mapped property cannot be accessed
[ http://issues.apache.org/jira/browse/BEANUTILS-113?page=all ] Niall Pemberton updated BEANUTILS-113: -- Bugzilla Id: (was: 32380) Component/s: Expression Syntax [beanutils] Indexed property inside a mapped property cannot be accessed Key: BEANUTILS-113 URL: http://issues.apache.org/jira/browse/BEANUTILS-113 Project: Commons BeanUtils Issue Type: Bug Components: Expression Syntax Affects Versions: 1.6 Environment: Operating System: All Platform: All Reporter: Firepica Hi, guys. Suppose I have a Map, let's call it building, inside that map I have an entry with key rooms, which is a Collection. If I try to access room number 20 like this: building.rooms[20].type it doesn't work (throws IllegalArgumentException). I made a custom implementation of building Map so that I can see what param is passed to the get() method. Surprisingly I see, that PropertyUtilsBean.getInstance().getProperty(bean, name) calls get() method on my Map with parameter rooms[20] (including index part). This is definitely a bug, because getProperty() should recognize, that rooms is an indexed property (because it has []), so it should cut off [20], call get(rooms) and then obtain element with index 20 from the retrieved Collection. Please have a look. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-112) [beanutils] defaultTransformers is public in BeanMap class
[ http://issues.apache.org/jira/browse/BEANUTILS-112?page=all ] Niall Pemberton updated BEANUTILS-112: -- Bugzilla Id: (was: 35267) Component/s: Bean-Collections [beanutils] defaultTransformers is public in BeanMap class -- Key: BEANUTILS-112 URL: http://issues.apache.org/jira/browse/BEANUTILS-112 Project: Commons BeanUtils Issue Type: Bug Components: Bean-Collections Affects Versions: 1.6 Environment: Operating System: other Platform: Other Reporter: Simon Kitching Fix For: 1.8.0 The BeanMap class in the optional section has: public static HashMap defaultTransformers = new HashMap(); I think this is a *really* bad idea. Firstly, because it's static, various parts of an application can interact in unexpected ways. For example, some library your code is calling might, unexpectedly, add a transformer to the default transformers causing surprising effects. That's even more interesting if the library (commons-collections or commons-beanutils) is deployed via a shared webapp in a container. In that case, one webapp can have side-effects on other webapps. And because it's a public member, there is no way to control access to this field. This class was in commons-collections since 1.0. It was copied into commons-beanutils before the 1.7.0 release, and deprecated in commons-collections. This class is only in the optional section, and is not used by the core beanutils code. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-109) [beanutils] BeanUtils.setProperty fails with mapped properties containing several MAPPED_DELIM2 characters
[ http://issues.apache.org/jira/browse/BEANUTILS-109?page=all ] Niall Pemberton updated BEANUTILS-109: -- Bugzilla Id: (was: 30637) Component/s: Expression Syntax [beanutils] BeanUtils.setProperty fails with mapped properties containing several MAPPED_DELIM2 characters -- Key: BEANUTILS-109 URL: http://issues.apache.org/jira/browse/BEANUTILS-109 Project: Commons BeanUtils Issue Type: Bug Components: Expression Syntax Affects Versions: 1.6 Environment: Operating System: All Platform: All Reporter: Alejandro H. Gil Sanda If you have some struts property of type HashMap in a form bean, and the key of the hashmap has an ( or an ) the method will incorrectly parse the name of the property causing struts to fail. html:text property=myhashmap(some_key_with_)_map_delim_in_it) / Some fix to the problem is to change the following lines: BeanUtils.java:375 - int k = propName.indexOf(PropertyUtils.MAPPED_DELIM2); + int k = propName.lastIndexOf(PropertyUtils.MAPPED_DELIM2); BeanUtils.java:914 - int k = propName.indexOf(PropertyUtils.MAPPED_DELIM2); + int k = propName.lastIndexOf(PropertyUtils.MAPPED_DELIM2); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-104) [beanutils]special characters in mapped property keys are parsed incorrectly
[ http://issues.apache.org/jira/browse/BEANUTILS-104?page=all ] Niall Pemberton updated BEANUTILS-104: -- Bugzilla Id: (was: 32748) Component/s: Expression Syntax [beanutils]special characters in mapped property keys are parsed incorrectly Key: BEANUTILS-104 URL: http://issues.apache.org/jira/browse/BEANUTILS-104 Project: Commons BeanUtils Issue Type: Bug Components: Expression Syntax Environment: Operating System: All Platform: All Reporter: rey abe When using mapped properties (the ones backed by a HashMap in the ActionForm), HashMap keys containing . or [ / ] characters will result in an Exception on submission of forms containing input elements with such keys. Obviously these characters are mistaken for subproperty and array delimiters when the RequestProcessor tries to populate the ActionForm. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-95) [beanutils] Handling exceptions during BeanUtils.populate()
[ http://issues.apache.org/jira/browse/BEANUTILS-95?page=all ] Niall Pemberton updated BEANUTILS-95: - Bugzilla Id: (was: 31571) Component/s: Bean / Property Utils [beanutils] Handling exceptions during BeanUtils.populate() --- Key: BEANUTILS-95 URL: http://issues.apache.org/jira/browse/BEANUTILS-95 Project: Commons BeanUtils Issue Type: Bug Components: Bean / Property Utils Environment: Operating System: other Platform: Other Reporter: Xavier Dury Hi, I know this has been asked already before but could there be a way to handle exceptions that occur during population? The populate() function could either return a map(property, exception), take that kind of map as argument or -even better- take a PopulateExceptionHandler as argument. The reason I would like to see this feature implemented is to allow struts to use this mechanism to convert parameters from the request to actionform's properties without *falling apart* when encountering one that is not well- formed. It would be nice too if we were not *forced* to use string-only properties for actionforms (which in fact is a way to circumvent this conversion problem). I would like my ActionForm or DynaActionForm declare strongly-typed properties (maybe custom classes), register proper Converters into ConvertUtils in the ActionServlet.initServlet() for example, and then maybe get back conversion errors from within my action (maybe the PopulateExceptionHandler could add some ActionErrors to the request). What do you think? I know this issue is tightly coupled to struts but well... ;-) Thanks a lot, Xavier -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[jira] Updated: (BEANUTILS-92) [beanutils] PropertyUtilsBean.copyProperties does not catch NoSuchMethodException
[ http://issues.apache.org/jira/browse/BEANUTILS-92?page=all ] Niall Pemberton updated BEANUTILS-92: - Bugzilla Id: (was: 35458) Component/s: Bean / Property Utils [beanutils] PropertyUtilsBean.copyProperties does not catch NoSuchMethodException - Key: BEANUTILS-92 URL: http://issues.apache.org/jira/browse/BEANUTILS-92 Project: Commons BeanUtils Issue Type: Bug Components: Bean / Property Utils Affects Versions: Nightly Builds Environment: Operating System: other Platform: Other Reporter: Will Pugh Fix For: 1.8.0 Attachments: fixCopyPropertyException I ran into a problem where I had a bean that had an IndexedSetter but no simple setter. This caused a NoSuchMethodException to get thrown in PropertyUtilsBean.copyProperties. This is inconsistant with BeanUtilsBean which catches this case and continues copying the other properties. When I asked about this in on the mailing list, the answer seemed to come back that this is probabaly incorrect behaviour, but it is possible people depend on this behaviour so this might be too big a change for a point release. I'm attaching the patch so it can be added to the next major release (if it is determined to be incorrect behaviour). The scenario I ran into this was one where I had a bean that I then used CGLib for enhancing. After that, the bean failed to be clonable by BeanUtils.clone. This could potentially become a big deal since Hibernate used CGLib for adding proxies to beans for lazy loading. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]