Correct validation of the Spring reference default bean attribute
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1074680 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
09f48367f8
commit
78b8dee581
1 changed files with 3 additions and 3 deletions
|
|
@ -728,14 +728,14 @@ public class SpringXMLComponentTypeLoader {
|
|||
Iterator<SpringSCAReferenceElement> itr = references.iterator();
|
||||
while (itr.hasNext()) {
|
||||
SpringSCAReferenceElement referenceElement = itr.next();
|
||||
boolean defaultBeanExists = true;
|
||||
boolean defaultBeanExists = false;
|
||||
boolean isUniqueReferenceName = true;
|
||||
Iterator<SpringBeanElement> itb = beans.iterator();
|
||||
while (itb.hasNext()) {
|
||||
SpringBeanElement beanElement = itb.next();
|
||||
if (referenceElement.getDefaultBean() != null)
|
||||
if (referenceElement.getDefaultBean().equals(beanElement.getId()))
|
||||
defaultBeanExists = false;
|
||||
defaultBeanExists = true;
|
||||
if (referenceElement.getName().equals(beanElement.getId()))
|
||||
isUniqueReferenceName = false;
|
||||
}
|
||||
|
|
@ -745,7 +745,7 @@ public class SpringXMLComponentTypeLoader {
|
|||
if (referenceElement.getName().equals(propertyElement.getName()))
|
||||
isUniqueReferenceName = false;
|
||||
}
|
||||
if (!defaultBeanExists)
|
||||
if (!defaultBeanExists && referenceElement.getDefaultBean() != null)
|
||||
error(monitor, "DefaultBeanDoesNotExist", beans);
|
||||
if (!isUniqueReferenceName)
|
||||
error(monitor, "ScaReferenceNameNotUnique", beans);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue