|
From: Hunter K. <re...@ei...> - 2004-06-02 17:17:33
|
I don't understand the rational of that. It seems very rare that you'd w= ant=20 to pass the same value multiple times into the constructor... I personally would expect "if the number of defined constructor-args exac= tly=20 match a defined constructor, and the types match, call that constructor". I don't think I'd like a constructor-arg to be matched any number of time= s... H On Wednesday 02 June 2004 18:01, j=FCrgen h=F6ller [werk3AT] wrote: > Sorry, step back: This is actually intended behavior. If you don't spec= ify > an index, the constructor argument value is considered generic, to be > matched any number of times. So in your case, simply add index attribut= es: > > <bean > id=3D"personType" > class=3D"com.marathon.util.sdo.DefaultType"> > > <constructor-arg index=3D"0"><ref bean=3D"entityType"/></constructo= r-arg> > <constructor-arg index=3D"1"><value>m:Person</value></constructor-a= rg> > > 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 other= s > first. I have a class with multiple constructors, two of which are def= ined > 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 i= n > "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 > > > ------------------------------------------------------- > 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 |