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%2FServiceInterfaceEntry.java;h=f03bd96529a728921bd656a5998bb4be2f79868c;hp=ef40d9515b42c75ad3b6d6e56456ea83a1912688;hb=940603a5319c9a0eff30e92f2dc83817974d7f78;hpb=f8ab6822a30746c21b50fa770a99910dc61e26c7 diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ServiceInterfaceEntry.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ServiceInterfaceEntry.java index ef40d9515b..f03bd96529 100644 --- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ServiceInterfaceEntry.java +++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ServiceInterfaceEntry.java @@ -7,6 +7,10 @@ */ package org.opendaylight.controller.config.yangjmxgenerator; +import static com.google.common.base.Preconditions.checkNotNull; +import static java.lang.String.format; +import static org.opendaylight.controller.config.yangjmxgenerator.ConfigConstants.SERVICE_TYPE_Q_NAME; + import com.google.common.base.Optional; import java.util.ArrayList; import java.util.HashMap; @@ -21,9 +25,6 @@ import org.opendaylight.yangtools.yang.model.api.Module; import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static com.google.common.base.Preconditions.checkNotNull; -import static java.lang.String.format; -import static org.opendaylight.controller.config.yangjmxgenerator.ConfigConstants.SERVICE_TYPE_Q_NAME; /** * Represents identity derived from {@link ConfigConstants#SERVICE_TYPE_Q_NAME}. @@ -46,7 +47,7 @@ import static org.opendaylight.controller.config.yangjmxgenerator.ConfigConstant *

*/ public class ServiceInterfaceEntry extends AbstractEntry { - private static final Logger logger = LoggerFactory + private static final Logger LOG = LoggerFactory .getLogger(ServiceInterfaceEntry.class); private static final String CLASS_NAME_SUFFIX = "ServiceInterface"; @@ -121,16 +122,16 @@ public class ServiceInterfaceEntry extends AbstractEntry { */ public static Map create(Module currentModule, String packageName,Map definedSEItracker) { - logger.debug("Generating ServiceInterfaces from {} to package {}", + LOG.debug("Generating ServiceInterfaces from {} to package {}", currentModule.getNamespace(), packageName); Map identitiesToSIs = new HashMap<>(); Set notVisited = new HashSet<>( currentModule.getIdentities()); int lastSize = notVisited.size() + 1; - while (notVisited.size() > 0) { + while (!notVisited.isEmpty()) { if (notVisited.size() == lastSize) { - logger.debug( + LOG.debug( "Following identities will be ignored while generating ServiceInterfaces, as they are not derived from {} : {}", SERVICE_TYPE_Q_NAME, notVisited); break; @@ -175,7 +176,7 @@ public class ServiceInterfaceEntry extends AbstractEntry { for (ServiceInterfaceEntry sie : identitiesToSIs.values()) { resultMap.put(sie.getQName(), sie); } - logger.debug("Number of ServiceInterfaces to be generated: {}", + LOG.debug("Number of ServiceInterfaces to be generated: {}", resultMap.size()); return resultMap; } @@ -198,25 +199,33 @@ public class ServiceInterfaceEntry extends AbstractEntry { @Override public boolean equals(Object o) { - if (this == o) + if (this == o) { return true; - if (o == null || getClass() != o.getClass()) + } + if (o == null || getClass() != o.getClass()) { return false; + } ServiceInterfaceEntry that = (ServiceInterfaceEntry) o; - if (!maybeBaseCache.equals(that.maybeBaseCache)) + if (!maybeBaseCache.equals(that.maybeBaseCache)) { return false; - if (!nullableDescription.equals(that.nullableDescription)) + } + if (!nullableDescription.equals(that.nullableDescription)) { return false; - if (!exportedOsgiClassName.equals(that.exportedOsgiClassName)) + } + if (!exportedOsgiClassName.equals(that.exportedOsgiClassName)) { return false; - if (!qName.equals(that.qName)) + } + if (!qName.equals(that.qName)) { return false; - if (!packageName.equals(that.packageName)) + } + if (!packageName.equals(that.packageName)) { return false; - if (!typeName.equals(that.typeName)) + } + if (!typeName.equals(that.typeName)) { return false; + } return true; }