X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fyang-jmx-generator%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyangjmxgenerator%2FModuleMXBeanEntryBuilder.java;h=518a11540e6c1ea33ebd3cf70909ad35b9874024;hp=d8c5a56fb7a7561de457894180ad1a1b418b7f57;hb=af915e9eea61824ff62c7fcfb138d4c81ed08136;hpb=79202e1fd05d2606b35e163f608fad9cce84b5d4 diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryBuilder.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryBuilder.java index d8c5a56fb7..518a11540e 100644 --- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryBuilder.java +++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryBuilder.java @@ -130,7 +130,7 @@ final class ModuleMXBeanEntryBuilder { Map result = new HashMap<>(); for (AugmentationSchema augmentation : currentModule.getAugmentations()) { - Set childNodes = augmentation.getChildNodes(); + Collection childNodes = augmentation.getChildNodes(); if (areAllChildrenChoiceCaseNodes(childNodes)) { for (ChoiceCaseNode childCase : castChildNodesToChoiceCases(childNodes)) { // TODO refactor, extract to standalone builder class @@ -215,7 +215,7 @@ final class ModuleMXBeanEntryBuilder { return moduleIdentities; } - private Collection castChildNodesToChoiceCases(final Set childNodes) { + private Collection castChildNodesToChoiceCases(final Collection childNodes) { return Collections2.transform(childNodes, new Function() { @Nullable @Override @@ -225,7 +225,7 @@ final class ModuleMXBeanEntryBuilder { }); } - private boolean areAllChildrenChoiceCaseNodes(final Set childNodes) { + private boolean areAllChildrenChoiceCaseNodes(final Iterable childNodes) { for (DataSchemaNode childNode : childNodes) { if (childNode instanceof ChoiceCaseNode == false) { return false; @@ -388,7 +388,7 @@ final class ModuleMXBeanEntryBuilder { * @return either choiceCaseNode or its only child container */ private HAS_CHILDREN_AND_QNAME getDataNodeContainer(final ChoiceCaseNode choiceCaseNode) { - Set childNodes = choiceCaseNode.getChildNodes(); + Collection childNodes = choiceCaseNode.getChildNodes(); if (childNodes.size() == 1) { DataSchemaNode onlyChild = childNodes.iterator().next(); if (onlyChild instanceof ContainerSchemaNode) { @@ -406,8 +406,7 @@ final class ModuleMXBeanEntryBuilder { final TypeProviderWrapper typeProviderWrapper, final Map qNamesToSIEs, final SchemaContext schemaContext, final String packageName) { Map yangToAttributes = new HashMap<>(); - Set childNodes = dataNodeContainer.getChildNodes(); - for (DataSchemaNode attrNode : childNodes) { + for (DataSchemaNode attrNode : dataNodeContainer.getChildNodes()) { AttributeIfc attributeValue = getAttributeValue(attrNode, currentModule, qNamesToSIEs, typeProviderWrapper, schemaContext, packageName); yangToAttributes.put(attributeValue.getAttributeYangName(), attributeValue);