DO NOT REPLY [Bug 14800] - Fix initialization bug and add size parameter to form-property

2002-12-24 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800

Fix initialization bug and add size parameter to form-property

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED



--- Additional Comments From [EMAIL PROTECTED]  2002-12-24 18:52 ---
The use cases you presented are compelling, and they apply to scalar properties
also.  I also added the logic to use a zero-args constructor if you didn't
specify an initial attribute value, and expanded the documentation on the
initial() method to precisely describe its semantics.  Unit tests too, of course :-)

Fixed in nightly build 20021225.

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




DO NOT REPLY [Bug 14800] - Fix initialization bug and add size parameter to form-property

2002-12-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800

Fix initialization bug and add size parameter to form-property

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED



--- Additional Comments From [EMAIL PROTECTED]  2002-12-23 22:02 ---
The size attribute was added in nightly build 20021224.  I'm still evaluating
the issues around cloning an array or not, so I'm leaving the bug open for now.

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




DO NOT REPLY [Bug 14800] - Fix initialization bug and add size parameter to form-property

2002-12-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800

Fix initialization bug and add size parameter to form-property

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |



--- Additional Comments From [EMAIL PROTECTED]  2002-12-24 02:50 ---

Eep.  Your patch of 20021224 is *almost* what I expected (initialization not 
withstanding)  As I envisioned it, size= would both create the array and 
populate it with the results of calling newInstance on the base class.  
While this might not be important for something like String, which will have 
the class instances overwritten when it is populated from a form, it is 
crucial for a class with properties being used in an iteration inside a form.  
As you coded things (leaving out this piece):

for (int j = 0; j  this.getSize(); j++) {
Array.set(a, j, componentType.newInstance());
}

there's no way to initialize the array elements to blank instances without 
writing a reset method, which means you can't use a DynaForm, which negates 
the value of size=

As you (Craig) may recall from our conversation, I thought we had agreed that 
the contract for an class that was used in size= would be that it's default 
constructor would be responsible for any initializations needed for use.

James

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




DO NOT REPLY [Bug 14800] - Fix initialization bug and add size parameter to form-property

2002-12-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800

Fix initialization bug and add size parameter to form-property

[EMAIL PROTECTED] changed:

   What|Removed |Added

  Component|Standard Actions|Utilities

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




DO NOT REPLY [Bug 14800] - Fix initialization bug and add size parameter to form-property

2002-12-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800

Fix initialization bug and add size parameter to form-property





--- Additional Comments From [EMAIL PROTECTED]  2002-12-09 03:08 ---
James,
I didn't forget about your request to apply this patch on the dev list.  But looking 
at the 
solution, I too am confused.  You say that the problem is that the array's values are 
not cloned but 
the solution doesn't address that properly.  It looks like brand new beans are put in 
the array 
instead of cloned versions of the existing values.  Martin's solution makes more sense 
to me.  
Maybe we should discuss this back on the dev list...

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




DO NOT REPLY [Bug 14800] - Fix initialization bug and add size parameter to form-property

2002-12-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800

Fix initialization bug and add size parameter to form-property





--- Additional Comments From [EMAIL PROTECTED]  2002-12-09 04:04 ---
My argument is this:

Yes, we could hold on to the array in an initialization variable, and then 
iterate over the elements cloning each one in turn each time a form was 
requisitioned.  However, this would require the element beans of the array to 
implement Cloneable, which isn't assured.  My solution is to simply request a 
new array from the Converter, which ensures that we get a fresh set of beans 
each time.

James

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




DO NOT REPLY [Bug 14800] - Fix initialization bug and add size parameter to form-property

2002-12-04 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800

Fix initialization bug and add size parameter to form-property





--- Additional Comments From [EMAIL PROTECTED]  2002-12-05 06:14 ---
I guess I'm confused by this patch, since it doesn't really seem to solve the 
problem, and it breaks backwards compatibility at the same time.

* If 'size' is not specified, there is no longer any special handling for an 
array, as there is today, so no cloning will happen at all, causing a worse 
problem than the bug report describes.

* If 'size' is specified, it is not possible to specify an initial value for 
any of the elements of the array. I would have thought that in this case you 
would at least want 'initial' to specify the value to be used for each element 
of the array.

To solve the original problem reported, it would seem to me that a much simpler 
solution would be to just replace this line:

Array.set(newValue, j, Array.get(initialValue, j));

with this one:

Array.set(newValue, j, Array.get(initialValue, j).clone());

Would this not work for some reason?

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




DO NOT REPLY [Bug 14800] - Fix initialization bug and add size parameter to form-property

2002-12-04 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800

Fix initialization bug and add size parameter to form-property





--- Additional Comments From [EMAIL PROTECTED]  2002-12-05 06:29 ---
You are correct sir, you are confused :-)

The code here can be a little confusing.  As originally written, initial() 
checked to see if a cached copy of the object existed, would use that as the 
initial value all future copies of this field.  If the field was an array of 
objects, it would clone the array (but not the objects that the array pointed 
to.)  As a result, all arrays shared the same objects.  For example, if I had 
an array initialized to an array of credit card numbers, the array would be 
clones but the credit card beans would be shared among all copies of the form, 
very bad.

This new version causes ConvertUtils.convert to be called in all cases, never 
caching the value, meaning that each form gets fresh beans.  Form properties 
are still initialized properly.

The size= is very useful, since in many cases you don't need to initialize the 
beans (i.e., the bean's constructor can set it up to be initialized.)  This 
saves you the trouble of having to write a custom converter to instantiate an 
array of beans.

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




DO NOT REPLY [Bug 14800] - Fix initialization bug and add size parameter to form-property

2002-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14800

Fix initialization bug and add size parameter to form-property





--- Additional Comments From [EMAIL PROTECTED]  2002-11-23 15:48 ---
Created an attachment (id=3931)
Diff file for initialization problem in DynaForms and addition of size parameter

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]