hmm... I was really thinking that this was only if the same id was used twice in a single xml file (or whatever is passed to the loadBeans() methods). So that wouldn't affect you, right?
-Dave On 7/10/06, Joe Rinehart <[EMAIL PROTECTED]> wrote:
Dave, Is it going to throw an error? I'll need to shift a bit of code in MG, but it really should use parent/child anyhow. -Joe On 7/10/06, Dave Ross <[EMAIL PROTECTED]> wrote: > Jon, > > Sounds reasonable - I'll just need to make sure that this doesn't > affect the hiearchical bean factory features, because by design you > *can* define the same bean in the parent and child factories (the > child bean would override/take precedence). > > thanks, > > Dave > > On 7/10/06, Jon Gunnip <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I just spent some time tracking down an error in CS where it turned out I > > had defined the same bean twice (due to copying and pasting some similar xml > > snippets). It would be helpful if CS had alerted me to this issue. Any > > reason why it shouldn't? Add the following code to loadBeanDefinitions() in > > DefaultXMLBeanFactory may to it. > > > > on line 128 in v1.0: > > <cfset var beansFound = "" > > > > > on line 156 in v1.0: > > <cfif structKeyExists( beansFound, beanAttributes.id )> > > <cfthrow type="coldspring.DuplicateBeanDefinitionException" > > message="bean with id #beanAttributes.id# defined multiple times" > > > </cfif> > > <cfset beansFound[beanAttributes.id] = 1 > > > > > This maybe a naive approach since I don't fully understand the CS code. > > Jon > > > > > > > > > > -- Get Glued! The Model-Glue ColdFusion Framework http://www.model-glue.com
