You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Niall Pemberton <ni...@blueyonder.co.uk> on 2004/07/12 02:37:42 UTC

[beanutils] Summary of propsed/committed changes for Bugs

Robert,

I thought I would just summarise what I've done on beanutils to date, so
that its easier for you (or others to review) - theres basically four main
pieces of work which I highlight in the "Summary" below, but I've also
detailed all the bugs I changed under "Detail" below.

SUMMARY
=========
1)   Committed fixes for Bug 28684 to the "numeric" locale converters and
added test cases.
2)   Added patch for review to Bug 29772 to fix issues in
DateLocaleConverter and addtional tests
3)   Added patch for review to Bug 23815 to fix issues in
PropertyUtilsBean - however these changes are also incorporated in the patch
attached to Bug 28813 below and its that patch that I hope to committ.
4)   Added patch for review to Bug 28813 to fix issues in
PropertyUtilsBean - working on addtional tests which I will attach to the
bug for review when I've completed them.


DETAIL
======

1) Bug 28254    getIndexedProperty problems on JDK 1.4.1
http://issues.apache.org/bugzilla/show_bug.cgi?id=28254

I closed this because it was a duplicate of Bug 28358 (same reporter and
same wording!)


2) Bug 28684    BigDecimalLocaleConverter seems not working as designed
http://issues.apache.org/bugzilla/show_bug.cgi?id=28684

BigDecimalLocaleConverter was basically returning the results of whatever
the DecimalFormat.parse() returned - i.e. either a Double or Long. The same
issue also existed in three of the other locale converter clases. This IMO
was a pretty straight forward bug and so I have actually committed fixes for
these and added unit tests for all the "numeric" locale converters and fixed
another small bug I found while testing.


3) Bug 29772    DateLocaleConverter does NOT return a default value if a
conversion error occurs
http://issues.apache.org/bugzilla/show_bug.cgi?id=29772

This bug I think might already have been resolved by previous changes.
Anyway I decided to add some more tests to DateLocaleConverterTestCase to
see if I could reproduce the problem and I found that while it worked under
JDK 1.3, I had a number of problems under JDK 1.4.  I have attached  a patch
to the bug with a workaround for these issues along with the modified Test
Case. Feedback on whether you (or anyone else) are happy for me to apply
this patch would be much appreciated.


4) Bug 23815, 26904 and 29571

Bug 23815   PropertyUtils.getNestedProperty() doesn't allow getXxxx on
Map-Instances any longer
Bug 26904  (g|s)etSimpleProperty fails when passing a Map
Bug 29571  Inconsistent behaviour of BeanUtils.setProperty() and
BeanUtils.getProperty() methods
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23815
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26904
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29571

These bugs all related to the same issue. Craig McClanahan posted concerns
in one of the bugs that what was being requested would break backward
compatibility. I believe that the change in behaviour I'm proposing
satisfies both camps and resolves the inconsistencies between some of the
methods. I've documented on Bug  23815 the changes in behaviour to
PropertyUtilsBean I'm proposing.


5) Bugs 23108 and 28813

Bug 28813    Can't use . (dot) in mapped properties for setProperty or
getPropertyDescriptor
Bug 23108    Setting complex mapped properties using PropertyUtils
http://issues.apache.org/bugzilla/show_bug.cgi?id=28813
http://issues.apache.org/bugzilla/show_bug.cgi?id=23108

Both these bugs deal with the same issue so I closed Bug 23108 as a
duplicate of 28813

PropertyUtils was changed in Bug 10478 so that "mapped" propery keys could
contain dot notation - but only the "get" method was changed, not the "set"
or getPropertyDescriptor" methods. I have attached a patch to the bug with
the changes to PropertyUtilsBean - the changes in the "diff" file look more
complex than they seem - all I did was copy the "while()" loop logic from
the get method to the set and getPropertyDescriptor methods, so that they
are all working consistently the same way.

These bugs were for the same class (PropertyUtilsBean) as for the Bugs in 4)
so the patch attached to Bug 28813 also includes the changes for the bugs in
4). Feedback on whether you (or anyone else) are happy for me to apply this
patch would be much appreciated.

I'm currently working on adding additional tests for this patch and will
attach it to the Bug 28813 when I've finished it.


Niall

----- Original Message ----- 
From: "robert burrell donkin" <ro...@blueyonder.co.uk>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Sunday, July 11, 2004 9:53 PM
Subject: Re: [beanutils] LazyDynaClass and LazyDynaBean Bug [29879]


> cool.
>
> i see you've added reviewed a good number of bugs reports (thanks).
> i'll try to find time to go through as many as possible of them
> tomorrow.
>
> the general plan for beanutils (and some background) is on the wiki. we
> need to cut a 1.7.0 service release that will give compatibility with
> both collections 2.x and 3.x. this will enable a similar release to be
> cut for digester and then (hopefully) one for struts as well.
>
> since beanutils has a load of outstanding bugs and enhancements against
> it, the plan is to try to aim for a relatively quick 1.7.1 bug
> fix/enhancement release.
>
> the major item of work remaining before 1.7.0 is released is a review
> of the interfaces for the new beanified classes. i'll probably post
> some more about this is a better named thread. i'd be grateful if you'd
> take a look and comment.
>
> - robert



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Summary of propsed/committed changes for Bugs

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On 14 Jul 2004, at 03:21, Niall Pemberton wrote:

> Robert,
>
> Thanks for your response. I've changed the copyright date to 2004 and
> changed the author to myself for the new classes.

great thanks :)

(i'll need a little time to consider the rest of your email.)

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Summary of propsed/committed changes for Bugs

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Robert,

Thanks for your response. I've changed the copyright date to 2004 and
changed the author to myself for the new classes.

As discussed elsewhere I agree with the decision to leave Bug 23815 but I
think that Bug 28813 (getNestedProperty handles Maps with a "dot notation"
but setNestedProperty and getPropertyDescriptor do not) should be fixed.
This seems a straight bug to me - setNestedProperty  and
getPropertyDescriptor don't work properly.

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

I've now attached revised patches for PropertyUtilsBean and the Test Case
that fix just this issue - all I did was change the "while loop" logic in
the setNestedProperty  and getPropertyDescriptor methods to the same as that
in getNestedProperty.

What do you think?

Niall


----- Original Message ----- 
From: "robert burrell donkin" <ro...@blueyonder.co.uk>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Tuesday, July 13, 2004 10:20 PM
Subject: Re: [beanutils] Summary of propsed/committed changes for Bugs


> On 12 Jul 2004, at 01:37, Niall Pemberton wrote:
>
> > Robert,
>
> Niall
>
> > I thought I would just summarise what I've done on beanutils to date,
> > so
> > that its easier for you (or others to review) - theres basically four
> > main
> > pieces of work which I highlight in the "Summary" below, but I've also
> > detailed all the bugs I changed under "Detail" below.
>
> good plan
>
> > SUMMARY
> > =========
> > 1)   Committed fixes for Bug 28684 to the "numeric" locale converters
> > and
> > added test cases.
>
> that's good work. for some reason, the commit email didn't seem to make
> it through so i took at the diffs using CVS. looks good but there are a
> couple of small improvements you could make to the new files you added:
> firstly, it's nice for the copyright to indicate 2004 (i know that the
> copyright dates are inaccurate in most of the files); secondly, you're
> the original author so either add your name or put something like
> jakarta commons team (as you wish) - there are too many files with my
> name at the top already, it's only fair that you start to share the
> blame ;)
>
> > 2)   Added patch for review to Bug 29772 to fix issues in
> > DateLocaleConverter and addtional tests
>
> took a look but found i couldn't do anything better than you (so
> committed the changes you proposed).
>
> > 3)   Added patch for review to Bug 23815 to fix issues in
> > PropertyUtilsBean - however these changes are also incorporated in the
> > patch
> > attached to Bug 28813 below and its that patch that I hope to committ.
> > 4)   Added patch for review to Bug 28813 to fix issues in
> > PropertyUtilsBean - working on addtional tests which I will attach to
> > the
> > bug for review when I've completed them.
>
> i'd prefer for these to be addressed more fuller in a subsequent
> release. i think probably craig right and we should discuss the right
> designs to take beanutils forwards. it'd be good if you could hang
> around for that...
>
> - robert
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Summary of propsed/committed changes for Bugs

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On 12 Jul 2004, at 01:37, Niall Pemberton wrote:

> Robert,

Niall

> I thought I would just summarise what I've done on beanutils to date, 
> so
> that its easier for you (or others to review) - theres basically four 
> main
> pieces of work which I highlight in the "Summary" below, but I've also
> detailed all the bugs I changed under "Detail" below.

good plan

> SUMMARY
> =========
> 1)   Committed fixes for Bug 28684 to the "numeric" locale converters 
> and
> added test cases.

that's good work. for some reason, the commit email didn't seem to make 
it through so i took at the diffs using CVS. looks good but there are a 
couple of small improvements you could make to the new files you added: 
firstly, it's nice for the copyright to indicate 2004 (i know that the 
copyright dates are inaccurate in most of the files); secondly, you're 
the original author so either add your name or put something like 
jakarta commons team (as you wish) - there are too many files with my 
name at the top already, it's only fair that you start to share the 
blame ;)

> 2)   Added patch for review to Bug 29772 to fix issues in
> DateLocaleConverter and addtional tests

took a look but found i couldn't do anything better than you (so 
committed the changes you proposed).

> 3)   Added patch for review to Bug 23815 to fix issues in
> PropertyUtilsBean - however these changes are also incorporated in the 
> patch
> attached to Bug 28813 below and its that patch that I hope to committ.
> 4)   Added patch for review to Bug 28813 to fix issues in
> PropertyUtilsBean - working on addtional tests which I will attach to 
> the
> bug for review when I've completed them.

i'd prefer for these to be addressed more fuller in a subsequent 
release. i think probably craig right and we should discuss the right 
designs to take beanutils forwards. it'd be good if you could hang 
around for that...

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Summary of propsed/committed changes for Bugs

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On 13 Jul 2004, at 00:56, Niall Pemberton wrote:

> Robert,

Niall

> No problem - its a good learning experience for me being new to this
> committership. I'd rather just work on one version at a time, so don't
> create a branch unless you have other reasons to. I'm happy to revisit
> anything that doesn't make this cut for a  later version. I'll wait 
> for your
> feedback on the other stuff I did.

branches are easy but you wouldn't need to worry about them :)

there's already a branch for the 1.7.0 release which i'm managing. if 
we elected to create a branch for the 1.7.1 release (so that HEAD can 
be freed for people to start working for example on beanutils 2.0) then 
i'd be happy to manage that as well.

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Summary of propsed/committed changes for Bugs

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Robert,

No problem - its a good learning experience for me being new to this
committership. I'd rather just work on one version at a time, so don't
create a branch unless you have other reasons to. I'm happy to revisit
anything that doesn't make this cut for a  later version. I'll wait for your
feedback on the other stuff I did.

Niall

----- Original Message ----- 
From: "robert burrell donkin" <ro...@blueyonder.co.uk>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Monday, July 12, 2004 9:55 PM
Subject: Re: [beanutils] Summary of propsed/committed changes for Bugs


> hi niall
>
> thanks again for the hard work. i'm starting now to go through the bugs
> reports.
>
> On 12 Jul 2004, at 20:01, Niall Pemberton wrote:
>
> > Its not an issue I have a strong opinion on - all I'm interested in is
> > helping resolve the outstanding beanutils bugs to move it nearer a
> > release.
>
> the plan (as far as the release goes) is to produce 1.7.0 service
> release to address the narrow issue of collections compatibility. it
> will also (incidentally) also introduce the beanification classes (so
> downstream projects - such as struts - can start thinking about how
> they want to move and so we can gain some feedback about issues such as
> configuration).
>
> originally when the plan was to do the usual bug fixes before the
> release but when i looked started to review the list of bugs, the list
> looked too long and too risky. however, beanutils has been neglected
> over a long period so i'd really like to find the energy to address as
> many as possible.
>
> > The question then is whats the best course of action in relation to
> > these
> > bugs?
>
> exactly what we're doing now :)
>
> it's crucial to think about the best courses of action and mull over
> possible solutions. it's very possible that we'll end up assigning
> different fixes to different releases. i'm as happy managing two
> release branches as one (if that's what's the best approach).
>
> <snip>
>
> > I guess I'm for the pargmatic option - because I'm just think of the
> > flood
> > of emails/bugs with doing the whole thing, what do you think?
>
> working on deep library components such as beanutils is often hard and
> unglamourous but you'll learn things working on these that you won't
> learn elsewhere. for beanutils, backwards compatibility is of crucial
> importance. it's important to apply narrow, focused fixes or to come up
> with ways to provide flexibility that allows users to choose the
> behaviour they want.
>
> for me, these bugs come under the general heading of bean query
> language enhancements. the problem is that we're constrained by
> backwards compatibility so there's a lot that we can't introduce at the
> moment. the idea behind the beanification changes is to make it easier
> to change stuff like the bean query language in both subtle and radical
> ways.
>
> i'd be very unhappy about breaking backwards compatibility for this fix
> but i do think that there's a definite user demand for an alternative
> implementation along the lines Niall has indicated. personally, i'd
> probably see such an implementation as an item for a 1.8.0 release. (i
> don't see any reason why beanutils releases 1.7.0 and 1.7.1 shouldn't
> happen relatively quickly.) if Niall fancies creating an alternative
> implementation that supports maps, then i'd be happy creating and
> managing a 1.7.1 release branch for the fixes.
>
> - robert
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Summary of propsed/committed changes for Bugs

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
hi niall

thanks again for the hard work. i'm starting now to go through the bugs 
reports.

On 12 Jul 2004, at 20:01, Niall Pemberton wrote:

> Its not an issue I have a strong opinion on - all I'm interested in is
> helping resolve the outstanding beanutils bugs to move it nearer a 
> release.

the plan (as far as the release goes) is to produce 1.7.0 service 
release to address the narrow issue of collections compatibility. it 
will also (incidentally) also introduce the beanification classes (so 
downstream projects - such as struts - can start thinking about how 
they want to move and so we can gain some feedback about issues such as 
configuration).

originally when the plan was to do the usual bug fixes before the 
release but when i looked started to review the list of bugs, the list 
looked too long and too risky. however, beanutils has been neglected 
over a long period so i'd really like to find the energy to address as 
many as possible.

> The question then is whats the best course of action in relation to 
> these
> bugs?

exactly what we're doing now :)

it's crucial to think about the best courses of action and mull over 
possible solutions. it's very possible that we'll end up assigning 
different fixes to different releases. i'm as happy managing two 
release branches as one (if that's what's the best approach).

<snip>

> I guess I'm for the pargmatic option - because I'm just think of the 
> flood
> of emails/bugs with doing the whole thing, what do you think?

working on deep library components such as beanutils is often hard and 
unglamourous but you'll learn things working on these that you won't 
learn elsewhere. for beanutils, backwards compatibility is of crucial 
importance. it's important to apply narrow, focused fixes or to come up 
with ways to provide flexibility that allows users to choose the 
behaviour they want.

for me, these bugs come under the general heading of bean query 
language enhancements. the problem is that we're constrained by 
backwards compatibility so there's a lot that we can't introduce at the 
moment. the idea behind the beanification changes is to make it easier 
to change stuff like the bean query language in both subtle and radical 
ways.

i'd be very unhappy about breaking backwards compatibility for this fix 
but i do think that there's a definite user demand for an alternative 
implementation along the lines Niall has indicated. personally, i'd 
probably see such an implementation as an item for a 1.8.0 release. (i 
don't see any reason why beanutils releases 1.7.0 and 1.7.1 shouldn't 
happen relatively quickly.) if Niall fancies creating an alternative 
implementation that supports maps, then i'd be happy creating and 
managing a 1.7.1 release branch for the fixes.

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Summary of propsed/committed changes for Bugs

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On 12 Jul 2004, at 21:56, Craig McClanahan wrote:

<snip>

> Maybe, as we go towards beanification, we can establish standard 
> instances that operate in the sorts of ways that people might want for 
> particular kinds of backwards compatibility.  But we should really 
> start thinking of a 2.0 sort of jump, and establish a new default set 
> of behaviors that are internally consistent.

hi craig

i don't have enough energy left to spare for beanutils to spearhead a 
2.0 effort but i'd be willing to help out (with stuff like releases and 
so on). i really think that we owe the users a bug fix release to 
follow 1.7.0 but maybe you're right and we should think about making 
1.7.x the last series of the original beanutils.

the real question is whether there's enough energy within the beanutils 
development community to sustain a 2.0 effort. realistically, i can't 
commit to being able to spend the time required beyond delivering the 
1.7.0 and 1.7.1 releases but if you're going to be around and Niall's 
keen to get involved then i'd be willing to help to kick start the 
effort by creating the organization for the 1.7.1 release early.

BTW you might have missed the release plans on the wiki 
(http://wiki.apache.org/jakarta-commons/BeanUtils)

as far as the 1.7.0 release goes, i'd like a second opinion on the 
reorganization of those interfaces (if you can find the time).

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Summary of propsed/committed changes for Bugs

Posted by Craig McClanahan <cr...@apache.org>.
Niall Pemberton wrote:

>Craig, thanks, I appreciate your feedback.
>
>Its not an issue I have a strong opinion on - all I'm interested in is
>helping resolve the outstanding beanutils bugs to move it nearer a release.
>The question then is whats the best course of action in relation to these
>bugs?
>
>The principle of "if the object you pass implements Map, it is *always*
>treated as a Map" seems sound to me and I'm happy to change the fixes I've
>worked on to do that. The issues I see are:
>
>A)  setNestedProperty already contains the behaviour you are against
>(getNestedProperty was inconsistent and doesn't) - PropertyUtils was
>modified back in  Nov 2002 (version 1.34) under Bug 14440 so that if the
>bean was a Map it first checked for a regular property before setting it in
>the Map. So the current Struts 1.1 behaviour is based on that.
>I guess there are three options:
>
>1)   Change getNestedProperty to implement the same behaviour - what I was
>proposing, but you are against
>2)   Remove this behaviour from setNestedProperty - this fits in with the
>principle you stated, but since Struts 1.1 is operating with this version
>seems to go against what you were saying about being backward compatible.
>3)   Do nothing, leaving the inconsistency - this is the one option I'm dead
>against
>
>
>B) The other part of the change was to the get/setSimpleProperty - they
>currently only update "regular" bean properties and don't handle Maps. Bug
>26904 asked that they did. Now I'm not sure whether you are against this
>part of the change or not and I guess we have three options here as well:
>
>1) Do nothing - don't handle Maps  (but this breaks the principle of if its
>a Map then ignore regular properties)
>2) Change get/setSimpleProperty as I was proposing (and what the bug asked
>for) which is if there isn't a simple property and its a Map, then set the
>Map's value.
>3) Change get/setSimpleProperty so that it first checks if the bean is a Map
>before looking for a regular property - that fits your principle but breaks
>backward compatibility.
>
>The more I write this email the more I like the principle, because its
>straight forward to explain/understand. However we would have to alter
>setNestedProperty to not set regular bean properties and change
>get/setSimpleProperty to check if its a Map first before setting the
>regaular property. I like this idea but the big issue would be backwards
>compatibility.
>
>I gues the pragmatic approach is just  to alter setNestedProperty to not set
>regular bean properties - makes it consistent with getNestedProperty and
>fits the principle - but leaves get/setSimpleProperty inconsistent with
>get/setNestedProperty.
>
>I guess I'm for the pargmatic option - because I'm just think of the flood
>of emails/bugs with doing the whole thing, what do you think?
>
>  
>
That's probably the best bet for now :-(.

Maybe, as we go towards beanification, we can establish standard 
instances that operate in the sorts of ways that people might want for 
particular kinds of backwards compatibility.  But we should really start 
thinking of a 2.0 sort of jump, and establish a new default set of 
behaviors that are internally consistent.

Craig


>Niall
>
>
>
>----- Original Message ----- 
>From: "Craig McClanahan" <cr...@apache.org>
>To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
>Sent: Monday, July 12, 2004 4:37 AM
>Subject: Re: [beanutils] Summary of propsed/committed changes for Bugs
>
>
>  
>
>>Niall Pemberton wrote:
>>
>>    
>>
>>>4) Bug 23815, 26904 and 29571
>>>
>>>Bug 23815   PropertyUtils.getNestedProperty() doesn't allow getXxxx on
>>>Map-Instances any longer
>>>Bug 26904  (g|s)etSimpleProperty fails when passing a Map
>>>Bug 29571  Inconsistent behaviour of BeanUtils.setProperty() and
>>>BeanUtils.getProperty() methods
>>>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23815
>>>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26904
>>>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29571
>>>
>>>These bugs all related to the same issue. Craig McClanahan posted
>>>      
>>>
>concerns
>  
>
>>>in one of the bugs that what was being requested would break backward
>>>compatibility. I believe that the change in behaviour I'm proposing
>>>satisfies both camps and resolves the inconsistencies between some of the
>>>methods. I've documented on Bug  23815 the changes in behaviour to
>>>PropertyUtilsBean I'm proposing.
>>>
>>>
>>>
>>>      
>>>
>>Niall,
>>
>>Thanks for taking the time to propose a solution to this problem, as
>>well as all the work you've done on the other BeanUtils issues.  As I
>>just posted in the comments on bug 23815, I'm deeply concerned that
>>changing this behavior will break Struts 1.1 apps (yes, I know that
>>people only now converting from Struts 1.0 would find it easier; but
>>it's the Struts 1.0 behavior that was badly broken).  What's worse is
>>the fact that this isn't the only case where a map is treated specially
>>-- exactly the same thing happens with the standard implementations of
>>dynabeans (including DynaActionForm in Struts 1.1).
>>
>>The standard implementations of expression evaluation (JSTL 1.0/1.1, JSP
>>2.0, JSF 1.0/1.1) all conform to the way that BeanUtils currently works
>>-- if the object you pass implements Map, it is *always* treated as a
>>Map.  This is further evidence that the right path for default behavior
>>lies in maintaining what we currently have, not going back to what was
>>broken.
>>
>>For making the Struts 1.0 transition easier, I'd be +1 on setting up a
>>BeanUtilsFactory that allows you to set the characteristics of the
>>BeanUtils instance to be created (somewhat like what JAXP does to set up
>>a parser instance that is either validating or non-validating, for
>>example).  But I'm -1 on changing the default behavior of these methods
>>until we do the beanification step.
>>
>>Craig
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>>
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Summary of propsed/committed changes for Bugs

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Craig, thanks, I appreciate your feedback.

Its not an issue I have a strong opinion on - all I'm interested in is
helping resolve the outstanding beanutils bugs to move it nearer a release.
The question then is whats the best course of action in relation to these
bugs?

The principle of "if the object you pass implements Map, it is *always*
treated as a Map" seems sound to me and I'm happy to change the fixes I've
worked on to do that. The issues I see are:

A)  setNestedProperty already contains the behaviour you are against
(getNestedProperty was inconsistent and doesn't) - PropertyUtils was
modified back in  Nov 2002 (version 1.34) under Bug 14440 so that if the
bean was a Map it first checked for a regular property before setting it in
the Map. So the current Struts 1.1 behaviour is based on that.
I guess there are three options:

1)   Change getNestedProperty to implement the same behaviour - what I was
proposing, but you are against
2)   Remove this behaviour from setNestedProperty - this fits in with the
principle you stated, but since Struts 1.1 is operating with this version
seems to go against what you were saying about being backward compatible.
3)   Do nothing, leaving the inconsistency - this is the one option I'm dead
against


B) The other part of the change was to the get/setSimpleProperty - they
currently only update "regular" bean properties and don't handle Maps. Bug
26904 asked that they did. Now I'm not sure whether you are against this
part of the change or not and I guess we have three options here as well:

1) Do nothing - don't handle Maps  (but this breaks the principle of if its
a Map then ignore regular properties)
2) Change get/setSimpleProperty as I was proposing (and what the bug asked
for) which is if there isn't a simple property and its a Map, then set the
Map's value.
3) Change get/setSimpleProperty so that it first checks if the bean is a Map
before looking for a regular property - that fits your principle but breaks
backward compatibility.

The more I write this email the more I like the principle, because its
straight forward to explain/understand. However we would have to alter
setNestedProperty to not set regular bean properties and change
get/setSimpleProperty to check if its a Map first before setting the
regaular property. I like this idea but the big issue would be backwards
compatibility.

I gues the pragmatic approach is just  to alter setNestedProperty to not set
regular bean properties - makes it consistent with getNestedProperty and
fits the principle - but leaves get/setSimpleProperty inconsistent with
get/setNestedProperty.

I guess I'm for the pargmatic option - because I'm just think of the flood
of emails/bugs with doing the whole thing, what do you think?

Niall



----- Original Message ----- 
From: "Craig McClanahan" <cr...@apache.org>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Monday, July 12, 2004 4:37 AM
Subject: Re: [beanutils] Summary of propsed/committed changes for Bugs


> Niall Pemberton wrote:
>
> >4) Bug 23815, 26904 and 29571
> >
> >Bug 23815   PropertyUtils.getNestedProperty() doesn't allow getXxxx on
> >Map-Instances any longer
> >Bug 26904  (g|s)etSimpleProperty fails when passing a Map
> >Bug 29571  Inconsistent behaviour of BeanUtils.setProperty() and
> >BeanUtils.getProperty() methods
> >http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23815
> >http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26904
> >http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29571
> >
> >These bugs all related to the same issue. Craig McClanahan posted
concerns
> >in one of the bugs that what was being requested would break backward
> >compatibility. I believe that the change in behaviour I'm proposing
> >satisfies both camps and resolves the inconsistencies between some of the
> >methods. I've documented on Bug  23815 the changes in behaviour to
> >PropertyUtilsBean I'm proposing.
> >
> >
> >
> Niall,
>
> Thanks for taking the time to propose a solution to this problem, as
> well as all the work you've done on the other BeanUtils issues.  As I
> just posted in the comments on bug 23815, I'm deeply concerned that
> changing this behavior will break Struts 1.1 apps (yes, I know that
> people only now converting from Struts 1.0 would find it easier; but
> it's the Struts 1.0 behavior that was badly broken).  What's worse is
> the fact that this isn't the only case where a map is treated specially
> -- exactly the same thing happens with the standard implementations of
> dynabeans (including DynaActionForm in Struts 1.1).
>
> The standard implementations of expression evaluation (JSTL 1.0/1.1, JSP
> 2.0, JSF 1.0/1.1) all conform to the way that BeanUtils currently works
> -- if the object you pass implements Map, it is *always* treated as a
> Map.  This is further evidence that the right path for default behavior
> lies in maintaining what we currently have, not going back to what was
> broken.
>
> For making the Struts 1.0 transition easier, I'd be +1 on setting up a
> BeanUtilsFactory that allows you to set the characteristics of the
> BeanUtils instance to be created (somewhat like what JAXP does to set up
> a parser instance that is either validating or non-validating, for
> example).  But I'm -1 on changing the default behavior of these methods
> until we do the beanification step.
>
> Craig
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [beanutils] Summary of propsed/committed changes for Bugs

Posted by Craig McClanahan <cr...@apache.org>.
Niall Pemberton wrote:

>4) Bug 23815, 26904 and 29571
>
>Bug 23815   PropertyUtils.getNestedProperty() doesn't allow getXxxx on
>Map-Instances any longer
>Bug 26904  (g|s)etSimpleProperty fails when passing a Map
>Bug 29571  Inconsistent behaviour of BeanUtils.setProperty() and
>BeanUtils.getProperty() methods
>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23815
>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26904
>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29571
>
>These bugs all related to the same issue. Craig McClanahan posted concerns
>in one of the bugs that what was being requested would break backward
>compatibility. I believe that the change in behaviour I'm proposing
>satisfies both camps and resolves the inconsistencies between some of the
>methods. I've documented on Bug  23815 the changes in behaviour to
>PropertyUtilsBean I'm proposing.
>
>  
>
Niall,

Thanks for taking the time to propose a solution to this problem, as 
well as all the work you've done on the other BeanUtils issues.  As I 
just posted in the comments on bug 23815, I'm deeply concerned that 
changing this behavior will break Struts 1.1 apps (yes, I know that 
people only now converting from Struts 1.0 would find it easier; but 
it's the Struts 1.0 behavior that was badly broken).  What's worse is 
the fact that this isn't the only case where a map is treated specially 
-- exactly the same thing happens with the standard implementations of 
dynabeans (including DynaActionForm in Struts 1.1).

The standard implementations of expression evaluation (JSTL 1.0/1.1, JSP 
2.0, JSF 1.0/1.1) all conform to the way that BeanUtils currently works 
-- if the object you pass implements Map, it is *always* treated as a 
Map.  This is further evidence that the right path for default behavior 
lies in maintaining what we currently have, not going back to what was 
broken.

For making the Struts 1.0 transition easier, I'd be +1 on setting up a 
BeanUtilsFactory that allows you to set the characteristics of the 
BeanUtils instance to be created (somewhat like what JAXP does to set up 
a parser instance that is either validating or non-validating, for 
example).  But I'm -1 on changing the default behavior of these methods 
until we do the beanification step.

Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org