|
From: <jue...@we...> - 2004-06-02 17:02:08
|
Sorry, step back: This is actually intended behavior. If you don't =
specify an index, the constructor argument value is considered generic, =
to be matched any number of times. So in your case, simply add index =
attributes:
<bean
id=3D"personType"
class=3D"com.marathon.util.sdo.DefaultType">
<constructor-arg index=3D"0"><ref =
bean=3D"entityType"/></constructor-arg>
<constructor-arg =
index=3D"1"><value>m:Person</value></constructor-arg>
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...]On Behalf
Of j=FCrgen h=F6ller [werk3AT]
Sent: Wednesday, June 02, 2004 6:40 PM
To: spr...@li...
Subject: Re: [Springframework-developer] Bug?
Indeed, that's a bug! I've just fixed it; will be part of 1.0.2.
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...]On Behalf
Of Andy Depue
Sent: Wednesday, June 02, 2004 6:17 PM
To: spr...@li...
Subject: [Springframework-developer] Bug?
I think I'm seeing a bug in Spring, but thought I'd bounce it off others =
first. I have a class with multiple constructors, two of which are =
defined=20
as follows:
public DefaultType(Type superType, String qualifiedName)
and:
public DefaultType(Type superType, String uri, String name)
I use the following XML to configure:
<bean
id=3D"personType"
class=3D"com.marathon.util.sdo.DefaultType">
<constructor-arg><ref bean=3D"entityType"/></constructor-arg>
<constructor-arg><value>m:Person</value></constructor-arg>
<property name=3D"typeProperties">
<list>
...
</list>
</property>
</bean>
Spring will call the second constructor instead of the first, passing in =
"m:Person" to both String parameters, equivalent to this:
new DefaultType(entityType, "m:Person", "m:Person")
Am I doing something wrong, or is this a bug? This is with Spring 1.0.1 =
(release)
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|