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