Merge "BUG-2288: DOMNotification API"
authorTony Tkacik <ttkacik@cisco.com>
Thu, 18 Dec 2014 14:13:12 +0000 (14:13 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 18 Dec 2014 14:13:12 +0000 (14:13 +0000)
178 files changed:
features/mdsal/pom.xml
opendaylight/adsal/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManager.java
opendaylight/adsal/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/IPHostId.java
opendaylight/adsal/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/IPMacHostId.java
opendaylight/adsal/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/HostTrackerCallable.java
opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/Entity.java
opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/SwitchPort.java
opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnector.java
opendaylight/adsal/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/Activator.java
opendaylight/adsal/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/BundleInfo.java
opendaylight/adsal/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/BundleScanner.java
opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/IteratableTypeInfo.java
opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/QueryContextImpl.java
opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/QueryImpl.java
opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/TypeInfo.java
opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/WrapperTypeInfo.java
opendaylight/adsal/northbound/connectionmanager/src/main/java/org/opendaylight/controller/connectionmanager/northbound/ConnectionManagerNorthbound.java
opendaylight/adsal/northbound/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/northbound/HostTrackerNorthbound.java
opendaylight/adsal/northbound/networkconfiguration/bridgedomain/src/main/java/org/opendaylight/controller/networkconfig/bridgedomain/northbound/BridgeDomainNorthbound.java
opendaylight/adsal/northbound/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/northbound/StaticRoutingNorthbound.java
opendaylight/adsal/northbound/statistics/src/main/java/org/opendaylight/controller/statistics/northbound/StatisticsNorthbound.java
opendaylight/adsal/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/StubNodeFactory.java
opendaylight/adsal/sal/connection/implementation/src/main/java/org/opendaylight/controller/sal/connection/implementation/internal/ConnectionService.java
opendaylight/adsal/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/ConfigManager.java
opendaylight/adsal/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/internal/LoadBalancerService.java
opendaylight/adsal/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/UserManager.java
opendaylight/adsal/web/root/pom.xml
opendaylight/adsal/web/root/src/main/java/org/opendaylight/controller/web/DaylightWeb.java
opendaylight/commons/liblldp/src/main/java/org/opendaylight/controller/liblldp/BitBufferHelper.java
opendaylight/commons/liblldp/src/main/java/org/opendaylight/controller/liblldp/DataLinkAddress.java
opendaylight/commons/liblldp/src/main/java/org/opendaylight/controller/liblldp/EthernetAddress.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/JmxAttributeValidationException.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtil.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/ConfigRegistryImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AbstractDynamicWrapper.java
opendaylight/config/config-persister-file-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/xml/XmlFileStorageAdapter.java
opendaylight/config/config-persister-file-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/xml/model/Config.java
opendaylight/config/logback-config/src/main/java/org/opendaylight/controller/config/yang/logback/config/LogbackStatusListener.java
opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModule.java
opendaylight/config/netty-timer-config/src/test/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModuleTest.java
opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/CloseableAsyncEventBus.java
opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/CloseableEventBus.java
opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/FixedThreadPoolWrapper.java
opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/FlexibleThreadPoolWrapper.java
opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/NamingThreadPoolFactory.java
opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/ScheduledThreadPoolWrapper.java
opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/yang/threadpool/impl/flexible/FlexibleThreadPoolModule.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/async/AsyncEventBusConfigBeanTest.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/eventbus/SyncEventBusConfigBeanTest.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/FixedThreadPoolConfigBeanTest.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/fixed/TestingFixedThreadPoolModule.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/flexible/FlexibleThreadPoolConfigBeanTest.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/naming/TestingNamingThreadPoolFactoryModule.java
opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/scheduled/TestingScheduledThreadPoolModule.java
opendaylight/config/yang-jmx-generator-it/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/it/ITTest.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/CodeWriter.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGenerator.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFactoryTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractFtlTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/AbstractModuleTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/FtlTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/GeneralClassTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/GeneralInterfaceTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/RuntimeRegistratorFtlTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/StubFactoryTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/TemplateFactory.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Annotation.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Field.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/HeaderSerializer.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ModuleField.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/TypeDeclaration.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/AbsModuleGeneratedObjectFactory.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/gofactory/ConcreteModuleGeneratedObjectFactory.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/FullyQualifiedName.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/GeneratedObject.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/GeneratedObjectBuilder.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/JavaFileInput.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/java/JavaFileInputBuilder.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtil.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/AbstractGeneratorTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGeneratorFileNamesValidationTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGeneratorGeneratedFilesTrackerTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGeneratorTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ModuleMXBeanEntryPluginTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ModuleMXBeanEntryTemplatesTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/RuntimeRegistratorFtlFileTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/AbstractGeneratedObjectTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/abs/AbsModuleGeneratedObjectFactoryTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/module/concrete/ConcreteModuleGeneratedObjectFactoryTest.java
opendaylight/config/yang-jmx-generator-plugin/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/StringUtilTest.java
opendaylight/config/yang-jmx-generator/pom.xml
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryBuilder.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/PackageTranslator.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/RuntimeBeanEntry.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/ServiceInterfaceEntry.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/AbstractAttribute.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/Dependency.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/DependencyAttribute.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/ListAttribute.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/ListDependenciesAttribute.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/SimpleTypeResolver.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/TOAttribute.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/FullyQualifiedNameHelper.java
opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/AbstractYangTest.java
opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryNameConflictTest.java
opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/ModuleMXBeanEntryTest.java
opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/PackageTranslatorTest.java
opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/RuntimeBeanEntryTest.java
opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/SchemaContextTest.java
opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/ServiceInterfaceEntryTest.java
opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/YangModelSearchUtils.java
opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/unknownextension/UnknownExtensionTest.java
opendaylight/config/yang-test-plugin/src/main/java/org/opendaylight/controller/config/yang/test/plugin/DeleteSources.java
opendaylight/config/yang-test-plugin/src/main/java/org/opendaylight/controller/config/yang/test/plugin/ProcessSources.java
opendaylight/config/yang-test/src/main/java/org/opendaylight/controller/config/yang/test/util/NetconfTestImplModuleUtil.java
opendaylight/config/yang-test/src/main/yang/config-test-impl.yang
opendaylight/config/yang-test/src/main/yang/types/test-groups.yang [new file with mode: 0644]
opendaylight/config/yang-test/src/main/yang/types/test-types.yang
opendaylight/config/yang-test/src/test/java/org/opendaylight/controller/config/yang/test/impl/NetconfTestImplModuleTest.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryBrokerWriteTransactionBenchmark.java
opendaylight/md-sal/mdsal-artifacts/pom.xml
opendaylight/md-sal/pom.xml
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Follower.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/FollowerTest.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRoutingTableImpl.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/DomToBindingRpcForwarder.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/DomToBindingRpcForwardingManager.java
opendaylight/md-sal/sal-clustering-commons/pom.xml
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/raft/protobuff/client/messages/CompositeModificationByteStringPayload.java [new file with mode: 0644]
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/AbstractDataModification.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/routing/RoutingUtils.java
opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Arguments.java
opendaylight/md-sal/sal-distributed-datastore/pom.xml
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/CompositeModificationByteStringPayloadTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomBrokerImplModule.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrint.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrintNode.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCConnection.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCResultSet.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCServer.java
opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfStateSchemas.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/util/RemoteDeviceId.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfDocumentedExceptionMapper.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/XmlNormalizedNodeBodyReader.java
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/XmlToCompositeNodeReader.java
opendaylight/md-sal/sal-rest-docgen-maven/pom.xml [new file with mode: 0644]
opendaylight/md-sal/sal-rest-docgen-maven/src/main/java/org/opendaylight/controller/sal/rest/doc/maven/StaticDocGenerator.java [moved from opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/impl/StaticDocGenerator.java with 86% similarity]
opendaylight/md-sal/sal-rest-docgen/pom.xml
opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/DocProvider.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/helper/FlowComparator.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/transactions/TransactionProvider.java
opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/NetconfMappingTest.java
opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpcElementResolvedTest.java
opendaylight/netconf/config-netconf-connector/src/test/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/NetconfOperationServiceImplTest.java
opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPersisterNotificationHandler.java
opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPusherImpl.java
opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfDocumentedException.java
opendaylight/netconf/netconf-impl/src/main/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiator.java
opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfServerSessionNegotiatorTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/AbstractNetconfConfigTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfConfigPersisterITTest.java
opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfITSecureTest.java
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfEXICodec.java
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfMessageToEXIEncoder.java
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfMessageToXMLEncoder.java
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/ThreadLocalTransformers.java [new file with mode: 0644]
opendaylight/netconf/netconf-testtool/src/main/java/org/opendaylight/controller/netconf/test/tool/NetconfDeviceSimulator.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XMLNetconfUtil.java
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/XmlUtil.java
opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/NetconfUtilTest.java
opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/xml/XmlUtilTest.java
opendaylight/netconf/pom.xml

index 6159922..d81da18 100644 (file)
   </properties>
 
   <dependencies>
+    <!-- Java -->
     <dependency>
-      <groupId>org.opendaylight.yangtools</groupId>
-      <artifactId>features-yangtools</artifactId>
+      <groupId>org.json</groupId>
+      <artifactId>json</artifactId>
+    </dependency>
+
+    <!-- Google -->
+    <dependency>
+      <groupId>com.google.code.gson</groupId>
+      <artifactId>gson</artifactId>
+    </dependency>
+
+    <!-- Jackson -->
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-annotations</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.datatype</groupId>
+      <artifactId>jackson-datatype-json-org</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.module</groupId>
+      <artifactId>jackson-module-jaxb-annotations</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.jaxrs</groupId>
+      <artifactId>jackson-jaxrs-base</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.jaxrs</groupId>
+      <artifactId>jackson-jaxrs-json-provider</artifactId>
+    </dependency>
+
+    <!-- Jersey -->
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-server</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-servlet</artifactId>
+    </dependency>
+
+    <!-- Netty -->
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-buffer</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-codec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-codec-http</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-handler</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-transport</artifactId>
+    </dependency>
+
+    <!-- OpenDaylight -->
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>features-akka</artifactId>
+      <version>${commons.opendaylight.version}</version>
       <classifier>features</classifier>
       <type>xml</type>
     </dependency>
       <classifier>features</classifier>
       <type>xml</type>
     </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
-      <artifactId>features-akka</artifactId>
-      <version>${commons.opendaylight.version}</version>
-      <classifier>features</classifier>
+      <artifactId>md-sal-config</artifactId>
+      <version>${mdsal.version}</version>
       <type>xml</type>
+      <classifier>config</classifier>
     </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-core-api</artifactId>
+      <artifactId>sal-akka-raft</artifactId>
+      <version>${mdsal.version}</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-broker-impl</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-dom-xsql</artifactId>
-    </dependency>
 
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-karaf-xsql</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-dom-xsql-config</artifactId>
-      <classifier>config</classifier>
-      <type>xml</type>
-    </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-binding-api</artifactId>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-connector-api</artifactId>
     </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-inmemory-datastore</artifactId>
+      <artifactId>sal-dom-xsql</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
-      <artifactId>md-sal-config</artifactId>
-      <version>${mdsal.version}</version>
-      <type>xml</type>
+      <artifactId>sal-dom-xsql-config</artifactId>
       <classifier>config</classifier>
+      <type>xml</type>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-distributed-datastore</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-remoterpc-connector</artifactId>
-    </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-clustering-commons</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-akka-raft</artifactId>
-      <version>${mdsal.version}</version>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-clustering-config</artifactId>
       <type>xml</type>
       <classifier>config</classifier>
     </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-netconf-connector</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.model</groupId>
-      <artifactId>model-inventory</artifactId>
+      <artifactId>sal-distributed-datastore</artifactId>
     </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
-      <artifactId>netconf-config-dispatcher</artifactId>
+      <artifactId>sal-inmemory-datastore</artifactId>
     </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
-      <artifactId>netconf-connector-config</artifactId>
-      <version>${netconf.version}</version>
-      <type>xml</type>
-      <classifier>config</classifier>
+      <artifactId>sal-netconf-connector</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-rest-connector</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.google.code.gson</groupId>
-      <artifactId>gson</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-server</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-servlet</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-buffer</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-codec</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-codec-http</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-common</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-handler</artifactId>
+      <artifactId>sal-remote</artifactId>
     </dependency>
     <dependency>
-      <groupId>io.netty</groupId>
-      <artifactId>netty-transport</artifactId>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal-remoterpc-connector</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-remote</artifactId>
+      <artifactId>sal-rest-connector</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <classifier>config</classifier>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.controller.samples</groupId>
-      <artifactId>sample-toaster</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.samples</groupId>
-      <artifactId>sample-toaster-provider</artifactId>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal-rest-docgen</artifactId>
     </dependency>
+
     <dependency>
-      <groupId>org.opendaylight.controller.samples</groupId>
-      <artifactId>sample-toaster-consumer</artifactId>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>netconf-config-dispatcher</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.controller.samples</groupId>
-      <artifactId>toaster-config</artifactId>
-      <version>${mdsal.version}</version>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>netconf-connector-config</artifactId>
+      <version>${netconf.version}</version>
       <type>xml</type>
       <classifier>config</classifier>
     </dependency>
+
     <dependency>
-      <groupId>org.opendaylight.controller.samples</groupId>
-      <artifactId>clustering-it-model</artifactId>
-      <version>${mdsal.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller.samples</groupId>
-      <artifactId>clustering-it-provider</artifactId>
-      <version>${mdsal.version}</version>
+      <groupId>org.opendaylight.controller.model</groupId>
+      <artifactId>model-inventory</artifactId>
     </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller.samples</groupId>
       <artifactId>clustering-it-config</artifactId>
       <artifactId>clustering-it-config</artifactId>
       <version>${mdsal.version}</version>
       <type>xml</type>
-      <classifier>testmoduleshardconf</classifier>
+      <classifier>testmoduleconf</classifier>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.controller.samples</groupId>
       <artifactId>clustering-it-config</artifactId>
       <version>${mdsal.version}</version>
       <type>xml</type>
-      <classifier>testmoduleconf</classifier>
-    </dependency>
-    <dependency>
-      <groupId>org.opendaylight.controller</groupId>
-      <artifactId>sal-rest-docgen</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-annotations</artifactId>
+      <classifier>testmoduleshardconf</classifier>
     </dependency>
     <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-core</artifactId>
+      <groupId>org.opendaylight.controller.samples</groupId>
+      <artifactId>clustering-it-model</artifactId>
+      <version>${mdsal.version}</version>
     </dependency>
     <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-databind</artifactId>
+      <groupId>org.opendaylight.controller.samples</groupId>
+      <artifactId>clustering-it-provider</artifactId>
+      <version>${mdsal.version}</version>
     </dependency>
+
+    <!-- toaster -->
     <dependency>
-      <groupId>com.fasterxml.jackson.datatype</groupId>
-      <artifactId>jackson-datatype-json-org</artifactId>
+      <groupId>org.opendaylight.controller.samples</groupId>
+      <artifactId>sample-toaster</artifactId>
     </dependency>
     <dependency>
-      <groupId>com.fasterxml.jackson.module</groupId>
-      <artifactId>jackson-module-jaxb-annotations</artifactId>
+      <groupId>org.opendaylight.controller.samples</groupId>
+      <artifactId>sample-toaster-consumer</artifactId>
     </dependency>
     <dependency>
-      <groupId>com.fasterxml.jackson.jaxrs</groupId>
-      <artifactId>jackson-jaxrs-base</artifactId>
+      <groupId>org.opendaylight.controller.samples</groupId>
+      <artifactId>sample-toaster-provider</artifactId>
     </dependency>
     <dependency>
-      <groupId>com.fasterxml.jackson.jaxrs</groupId>
-      <artifactId>jackson-jaxrs-json-provider</artifactId>
+      <groupId>org.opendaylight.controller.samples</groupId>
+      <artifactId>toaster-config</artifactId>
+      <version>${mdsal.version}</version>
+      <type>xml</type>
+      <classifier>config</classifier>
     </dependency>
+
+    <!-- yang -->
     <dependency>
-      <groupId>org.json</groupId>
-      <artifactId>json</artifactId>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>features-yangtools</artifactId>
+      <classifier>features</classifier>
+      <type>xml</type>
     </dependency>
+
     <!-- test to validate features.xml -->
     <dependency>
       <groupId>org.opendaylight.yangtools</groupId>
           </dependency>
           <dependency>
             <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-rest-docgen</artifactId>
+            <artifactId>sal-rest-docgen-maven</artifactId>
             <version>${mdsal.version}</version>
             <type>jar</type>
           </dependency>
               <yangFilesRootDir>src</yangFilesRootDir>
               <codeGenerators>
                 <generator>
-                  <codeGeneratorClass>org.opendaylight.controller.sal.rest.doc.impl.StaticDocGenerator</codeGeneratorClass>
+                  <codeGeneratorClass>org.opendaylight.controller.sal.rest.doc.maven.StaticDocGenerator</codeGeneratorClass>
                   <outputBaseDir>${project.build.directory}/generated-resources/swagger-api-documentation/explorer/static</outputBaseDir>
                 </generator>
               </codeGenerators>
index e34eb32..4febcd0 100644 (file)
@@ -457,7 +457,9 @@ public class ClusterManager implements IClusterServices {
             return null;
         }
         for (String cacheName : manager.getCacheNames()) {
-            if (!manager.isRunning(cacheName)) continue;
+            if (!manager.isRunning(cacheName)) {
+                continue;
+            }
             if (cacheName.startsWith("{" + containerName + "}_")) {
                 String[] res = cacheName.split("[{}]");
                 if (res.length >= 4 && res[1].equals(containerName)
index b8b54b4..a6314e0 100644 (file)
@@ -42,18 +42,23 @@ public class IPHostId implements IHostId, Serializable {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         IPHostId other = (IPHostId) obj;
         if (ipAddress == null) {
-            if (other.ipAddress != null)
+            if (other.ipAddress != null) {
                 return false;
-        } else if (!ipAddress.equals(other.ipAddress))
+            }
+        } else if (!ipAddress.equals(other.ipAddress)) {
             return false;
+        }
         return true;
     }
 
index e10c5d1..19f3f58 100644 (file)
@@ -56,23 +56,30 @@ public class IPMacHostId implements IHostId, Serializable {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         IPMacHostId other = (IPMacHostId) obj;
         if (ipAddress == null) {
-            if (other.ipAddress != null)
+            if (other.ipAddress != null) {
                 return false;
-        } else if (!ipAddress.equals(other.ipAddress))
+            }
+        } else if (!ipAddress.equals(other.ipAddress)) {
             return false;
+        }
         if (macAddr == null) {
-            if (other.macAddr != null)
+            if (other.macAddr != null) {
                 return false;
-        } else if (!macAddr.equals(other.macAddr))
+            }
+        } else if (!macAddr.equals(other.macAddr)) {
             return false;
+        }
         return true;
     }
 
index a1d29dd..59b4a08 100644 (file)
@@ -44,8 +44,9 @@ public class HostTrackerCallable implements Callable<HostNodeConnector> {
     @Override
     public HostNodeConnector call() throws Exception {
         HostNodeConnector h = hostTracker.hostFind(trackedHost);
-        if (h != null)
+        if (h != null) {
             return h;
+        }
         hostTracker.setCallableOnPendingARP(trackedHost, this);
         Thread.sleep(2000); // wait 2sec to see if the host responds
         return hostTracker.hostQuery(trackedHost);
index 64f4c7e..f10c116 100644 (file)
@@ -165,8 +165,9 @@ public class Entity implements Comparable<Entity> {
     public void setLastSeenTimestamp(Date lastSeenTimestamp) {
         if (activeSince == null
                 || (activeSince.getTime() + ACTIVITY_TIMEOUT) < lastSeenTimestamp
-                        .getTime())
+                        .getTime()) {
             this.activeSince = lastSeenTimestamp;
+        }
         this.lastSeenTimestamp = lastSeenTimestamp;
     }
 
@@ -180,8 +181,9 @@ public class Entity implements Comparable<Entity> {
 
     @Override
     public int hashCode() {
-        if (hashCode != 0)
+        if (hashCode != 0) {
             return hashCode;
+        }
         final int prime = 31;
         hashCode = 1;
         hashCode = prime * hashCode
@@ -194,30 +196,40 @@ public class Entity implements Comparable<Entity> {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         Entity other = (Entity) obj;
         if (ipv4Address == null) {
-            if (other.ipv4Address != null)
+            if (other.ipv4Address != null) {
                 return false;
-        } else if (!ipv4Address.equals(other.ipv4Address))
+            }
+        } else if (!ipv4Address.equals(other.ipv4Address)) {
             return false;
-        if (macAddress != other.macAddress)
+        }
+        if (macAddress != other.macAddress) {
             return false;
+        }
         if (port == null) {
-            if (other.port != null)
+            if (other.port != null) {
                 return false;
-        } else if (!port.equals(other.port))
+            }
+        } else if (!port.equals(other.port)) {
             return false;
+        }
         if (vlan == null) {
-            if (other.vlan != null)
+            if (other.vlan != null) {
                 return false;
-        } else if (!vlan.equals(other.vlan))
+            }
+        } else if (!vlan.equals(other.vlan)) {
             return false;
+        }
         return true;
     }
 
@@ -257,8 +269,9 @@ public class Entity implements Comparable<Entity> {
             Comparable switchId = (Comparable) port.getNode().getID();
             Comparable oswitchId = (Comparable) o.port.getNode().getID();
             r = switchId.compareTo(oswitchId);
-            if (r != 0)
+            if (r != 0) {
                 return r;
+            }
 
             Comparable portId = (Comparable) port.getID();
             Comparable oportId = (Comparable) o.port.getID();
index e60f8b4..892e1d6 100644 (file)
@@ -127,20 +127,26 @@ public class SwitchPort {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         SwitchPort other = (SwitchPort) obj;
-        if (errorStatus != other.errorStatus)
+        if (errorStatus != other.errorStatus) {
             return false;
+        }
         if (port == null) {
-            if (other.port != null)
+            if (other.port != null) {
                 return false;
-        } else if (!port.equals(other.port))
+            }
+        } else if (!port.equals(other.port)) {
             return false;
+        }
         return true;
     }
 
index fe396ba..86376be 100644 (file)
@@ -150,22 +150,29 @@ public class HostNodeConnector extends Host {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (!super.equals(obj))
+        }
+        if (!super.equals(obj)) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         HostNodeConnector other = (HostNodeConnector) obj;
         if (nodeConnector == null) {
-            if (other.nodeConnector != null)
+            if (other.nodeConnector != null) {
                 return false;
-        } else if (!nodeConnector.equals(other.nodeConnector))
+            }
+        } else if (!nodeConnector.equals(other.nodeConnector)) {
             return false;
-        if (staticHost != other.staticHost)
+        }
+        if (staticHost != other.staticHost) {
             return false;
-        if (vlan != other.vlan)
+        }
+        if (vlan != other.vlan) {
             return false;
+        }
         return true;
     }
 
@@ -181,8 +188,9 @@ public class HostNodeConnector extends Host {
             EthernetAddress e = (EthernetAddress) getDataLayerAddress();
             macaddr = e.getValue();
         }
-        if (macaddr == null)
+        if (macaddr == null) {
             return false;
+        }
         return !Arrays.equals(emptyArray, macaddr);
     }
 
index 69c8124..abe8618 100644 (file)
@@ -38,7 +38,9 @@ public class Activator extends ComponentActivatorAbstractBase {
 
     @Override
     protected void configureGlobalInstance(Component c, Object imp) {
-        if (!imp.equals(BundleScanServiceImpl.class)) return;
+        if (!imp.equals(BundleScanServiceImpl.class)) {
+            return;
+        }
         // export service
         c.setInterface(
                 new String[] { IBundleScanService.class.getName() },
index 9cb1cb5..31c81da 100644 (file)
@@ -73,10 +73,14 @@ import org.slf4j.LoggerFactory;
     }
 
     private boolean matches(Pattern pattern, Set<String> values) {
-        if (pattern == null) return true;
+        if (pattern == null) {
+            return true;
+        }
         //LOGGER.debug("Matching: {} {}", pattern.toString(), values);
         for (String s : values) {
-            if (pattern.matcher(s).find()) return true;
+            if (pattern.matcher(s).find()) {
+                return true;
+            }
         }
         return false;
     }
@@ -130,7 +134,9 @@ import org.slf4j.LoggerFactory;
             Bundle initBundle, Set<String> excludes)
     {
         for (BundleInfo other : bundlesToScan) {
-            if (other.getId() == target.getId()) continue;
+            if (other.getId() == target.getId()) {
+                continue;
+            }
             if (target.isDependantOn(other)) {
                 if (!visited.contains(other)) {
                     classes.addAll(BundleScanner.loadClasses(
@@ -146,7 +152,9 @@ import org.slf4j.LoggerFactory;
 
     private boolean isDependantOn(BundleInfo other) {
         for (String pkg : importPkgs) {
-            if (other.exportPkgs.contains(pkg)) return true;
+            if (other.exportPkgs.contains(pkg)) {
+                return true;
+            }
         }
         return false;
     }
@@ -154,14 +162,18 @@ import org.slf4j.LoggerFactory;
     public List<BundleInfo> getDependencies(Collection<BundleInfo> bundles) {
         List<BundleInfo> result = new ArrayList<BundleInfo>();
         for(BundleInfo bundle : bundles) {
-            if (isDependantOn(bundle)) result.add(bundle);
+            if (isDependantOn(bundle)) {
+                result.add(bundle);
+            }
         }
         return result;
     }
 
 
     private static Set<String> parsePackages(String packageString) {
-        if (packageString == null) return Collections.emptySet();
+        if (packageString == null) {
+            return Collections.emptySet();
+        }
         String[] packages = packageString.split(",");
         Set<String> result = new HashSet<String>();
         for (int i=0; i<packages.length; i++) {
index 2fee272..f6b604d 100644 (file)
@@ -72,7 +72,9 @@ import org.slf4j.LoggerFactory;
             boolean includeDependentBundleClasses)
     {
         BundleInfo info = bundleAnnotations.get(context.getBundle().getBundleId());
-        if (info == null) return Collections.emptyList();
+        if (info == null) {
+            return Collections.emptyList();
+        }
         Pattern pattern = mergePatterns(annotations, false);
         List<Class<?>> result = null;
         if (includeDependentBundleClasses) {
@@ -254,7 +256,9 @@ import org.slf4j.LoggerFactory;
         StringBuilder errors = new StringBuilder();
         for (String name : annotatedClasses) {
             try {
-                if (excludes != null && excludes.contains(name)) continue;
+                if (excludes != null && excludes.contains(name)) {
+                    continue;
+                }
                 result.add(initBundle.loadClass(name));
             } catch (ClassNotFoundException e) {
                 errors.append(name).append(", ");
@@ -276,7 +280,9 @@ import org.slf4j.LoggerFactory;
             if (c.endsWith("*")) {
                 c = c.substring(0, c.length() - 1);
             }
-            if (regex.length() > 0) regex.append("|");
+            if (regex.length() > 0) {
+                regex.append("|");
+            }
             regex.append("^");
             if (convert2signature) {
                 regex.append("L").append(c.replaceAll("\\.", "/"));
@@ -291,12 +297,16 @@ import org.slf4j.LoggerFactory;
     }
 
     private void validate(List<Class<?>> classes) {
-        if (classes == null || classes.size() == 0) return;
+        if (classes == null || classes.size() == 0) {
+            return;
+        }
         Map<String,String> names = new HashMap<String,String>();
         StringBuilder conflictsMsg = new StringBuilder();
         for (Class<?> c : classes) {
             XmlRootElement root = c.getAnnotation(XmlRootElement.class);
-            if (root == null) continue;
+            if (root == null) {
+                continue;
+            }
             String rootName = root.name();
             if ("##default".equals(rootName)) {
                 String clsName = c.getSimpleName();
index 3977837..d0386ed 100644 (file)
@@ -29,7 +29,9 @@ import java.util.List;
             Object item = it.next();
             for (TypeInfo child : _types.values()) {
                 Object val = child.retrieve(item, query, index);
-                if (val != null) objects.add(val);
+                if (val != null) {
+                    objects.add(val);
+                }
             }
         }
         return objects;
@@ -38,7 +40,9 @@ import java.util.List;
 
     @Override
     public synchronized void explore() {
-        if (_explored) return;
+        if (_explored) {
+            return;
+        }
         if (LOGGER.isDebugEnabled()) {
             LOGGER.debug("exploring iteratable type: {} gtype: {}", _class,
                     _accessor.getGenericType());
index 13d70b1..8f83c14 100644 (file)
@@ -16,17 +16,25 @@ import org.slf4j.LoggerFactory;
 
     @Override
     public <T> Query<T> createQuery(String queryString, Class<T> type) throws QueryException {
-        if (queryString == null || queryString.trim().length() == 0) return null;
+        if (queryString == null || queryString.trim().length() == 0) {
+            return null;
+        }
         try {
-            if (LOGGER.isDebugEnabled()) LOGGER.debug("Processing query: {}", queryString);
+            if (LOGGER.isDebugEnabled()) {
+                LOGGER.debug("Processing query: {}", queryString);
+            }
             // FiqlParser is a parser generated by javacc
             Expression expression = FiqlParser.parse(queryString);
-            if (LOGGER.isDebugEnabled()) LOGGER.debug("Query expression: {}", expression);
+            if (LOGGER.isDebugEnabled()) {
+                LOGGER.debug("Query expression: {}", expression);
+            }
             // create Query and return;
             return new QueryImpl<T>(type, expression);
         } catch (Exception ex) {
-            if (LOGGER.isDebugEnabled()) LOGGER.error("Query processing failed = {}",
+            if (LOGGER.isDebugEnabled()) {
+                LOGGER.error("Query processing failed = {}",
                     queryString, ex);
+            }
             throw new QueryException("Unable to parse query.", ex);
         }
     }
index a520f98..cb77e04 100644 (file)
@@ -158,7 +158,9 @@ import org.slf4j.LoggerFactory;
     }
 
     private boolean compare(Object valueToMatch, Object actualValue, OP operator) {
-        if (valueToMatch == null || actualValue == null) return false;
+        if (valueToMatch == null || actualValue == null) {
+            return false;
+        }
         if (ALLOW_OBJECT_STRING_COMPARE && (valueToMatch instanceof String)
                 && !(actualValue instanceof String)) {
             actualValue = actualValue.toString();
@@ -203,7 +205,9 @@ import org.slf4j.LoggerFactory;
         }
     }
     private Object parse(String arg, Object value) {
-        if (value == null) return null;
+        if (value == null) {
+            return null;
+        }
 
         try {
             if (value instanceof String) {
index 91f01d8..6c0c5dc 100644 (file)
@@ -107,7 +107,9 @@ import org.slf4j.LoggerFactory;
         if (LOGGER.isDebugEnabled()) {
             LOGGER.debug("retrieve: {}/{} type:{}", index, query.length, target.getClass());
         }
-        if (index >= query.length) return null;
+        if (index >= query.length) {
+            return null;
+        }
         explore();
         if (!target.getClass().equals(_class)) {
             if (_class.isAssignableFrom(target.getClass())) {
@@ -124,7 +126,9 @@ import org.slf4j.LoggerFactory;
             }
         }
         TypeInfo child = getChild(query[index]);
-        if (child == null) return null;
+        if (child == null) {
+            return null;
+        }
         target = child.getAccessor().getValue(target);
         if (index+1 == query.length) {
             // match found
@@ -137,27 +141,35 @@ import org.slf4j.LoggerFactory;
      * Explore the type info for children.
      */
     public synchronized void explore() {
-        if (_explored) return;
+        if (_explored) {
+            return;
+        }
         for (Class<?> c = _class; c != null; c = c.getSuperclass()) {
-            if (c.equals(Object.class)) break;
+            if (c.equals(Object.class)) {
+                break;
+            }
             // Currently only fields and methods annotated with JAXB annotations are
             // considered as valid for search purposes.
             //check methods first
             for (Method m : c.getDeclaredMethods()) {
                 String tn = getTypeName(m, _accessType);
                 if (tn != null) {
-                    if (LOGGER.isDebugEnabled()) LOGGER.debug(
+                    if (LOGGER.isDebugEnabled()) {
+                        LOGGER.debug(
                             "exploring type: {} name: {} method: {}",
                             _class.getSimpleName(), tn, m);
+                    }
                     _types.put(tn, createTypeInfo(tn, new Accessor(m)));
                 }
             }
             for (Field f : c.getDeclaredFields()) {
                 String tn = getTypeName(f, _accessType);
                 if (tn != null) {
-                    if (LOGGER.isDebugEnabled()) LOGGER.debug(
+                    if (LOGGER.isDebugEnabled()) {
+                        LOGGER.debug(
                             "exploring type: {} name: {} field: {}",
                             _class.getSimpleName(), tn, f);
+                    }
                     _types.put(tn, createTypeInfo(tn, new Accessor(f)));
                 }
             }
@@ -219,7 +231,9 @@ import org.slf4j.LoggerFactory;
             PropertyDescriptor[] props = info.getPropertyDescriptors();
             for (PropertyDescriptor pd : props)
             {
-                if (m.equals(pd.getReadMethod())) return pd.getName();
+                if (m.equals(pd.getReadMethod())) {
+                    return pd.getName();
+                }
             }
         }
         catch (IntrospectionException e)
@@ -234,8 +248,12 @@ import org.slf4j.LoggerFactory;
         // root is always a composite type
         // FIXME assert its a JAXB type
         XmlRootElement root = clz.getAnnotation(XmlRootElement.class);
-        if (root == null) throw new IllegalArgumentException("Not a JAXB type: " + clz);
-        if (name == null) name = getRootName(clz);
+        if (root == null) {
+            throw new IllegalArgumentException("Not a JAXB type: " + clz);
+        }
+        if (name == null) {
+            name = getRootName(clz);
+        }
         return new TypeInfo(name, clz, null);
     }
 
@@ -252,7 +270,9 @@ import org.slf4j.LoggerFactory;
 
     public static String getRootName(Class<?> cls) {
         XmlRootElement root = cls.getAnnotation(XmlRootElement.class);
-        if (root == null) return null;
+        if (root == null) {
+            return null;
+        }
         String rootName = root.name();
         if (DEFAULT_NAME.equals(rootName)) {
             String clsName = cls.getSimpleName();
@@ -281,7 +301,9 @@ import org.slf4j.LoggerFactory;
                 return null;
             }
         }
-        if (DEFAULT_NAME.equals(name)) return dflt;
+        if (DEFAULT_NAME.equals(name)) {
+            return dflt;
+        }
         return name;
     }
 
index a8172f2..156942c 100644 (file)
@@ -24,10 +24,14 @@ public class WrapperTypeInfo extends TypeInfo {
         if (LOGGER.isDebugEnabled()) {
             LOGGER.debug("retrieve collection: {}/{}", index, query.length);
         }
-        if (index >= query.length) return null;
+        if (index >= query.length) {
+            return null;
+        }
         explore();
         TypeInfo child = getChild(query[index]);
-        if (child == null) return null;
+        if (child == null) {
+            return null;
+        }
         if (query.length == index+1) { // skipping this node
             return target;
         }else { // if list of list go to next node to get value
@@ -37,7 +41,9 @@ public class WrapperTypeInfo extends TypeInfo {
 
     @Override
     public synchronized void explore() {
-        if (_explored) return;
+        if (_explored) {
+            return;
+        }
         if (LOGGER.isDebugEnabled()) {
             LOGGER.debug("exploring wrapper type: {} gtype: {}", _class,
                     _accessor.getGenericType());
index dde3210..3f64b07 100644 (file)
@@ -62,7 +62,9 @@ public class ConnectionManagerNorthbound {
     }
     @Context
     public void setSecurityContext(SecurityContext context) {
-        if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+        if (context != null && context.getUserPrincipal() != null) {
+            username = context.getUserPrincipal().getName();
+        }
     }
     protected String getUserName() {
         return username;
index d7579c8..3769cc7 100644 (file)
@@ -83,7 +83,9 @@ public class HostTrackerNorthbound {
 
     @Context
     public void setSecurityContext(SecurityContext context) {
-        if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+        if (context != null && context.getUserPrincipal() != null) {
+            username = context.getUserPrincipal().getName();
+        }
     }
 
     protected String getUserName() {
index 9ddba67..8aea7e5 100644 (file)
@@ -54,7 +54,9 @@ public class BridgeDomainNorthbound {
 
     @Context
     public void setSecurityContext(SecurityContext context) {
-        if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+        if (context != null && context.getUserPrincipal() != null) {
+          username = context.getUserPrincipal().getName();
+        }
     }
     protected String getUserName() {
         return username;
index 20f6cb4..de291d6 100644 (file)
@@ -88,7 +88,9 @@ public class StaticRoutingNorthbound {
 
     @Context
     public void setSecurityContext(SecurityContext context) {
-        if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+        if (context != null && context.getUserPrincipal() != null) {
+            username = context.getUserPrincipal().getName();
+        }
     }
     protected String getUserName() {
         return username;
index 4175f1e..ad9d126 100644 (file)
@@ -70,7 +70,9 @@ public class StatisticsNorthbound {
     }
     @Context
     public void setSecurityContext(SecurityContext context) {
-        if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+        if (context != null && context.getUserPrincipal() != null) {
+            username = context.getUserPrincipal().getName();
+        }
     }
 
     protected String getUserName() {
index c5a9de3..439519f 100644 (file)
@@ -11,45 +11,44 @@ import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.utils.INodeFactory;
 import org.opendaylight.controller.sal.core.Node;
 
-public class StubNodeFactory implements INodeFactory
-    {
-      void init() {
-      }
+public class StubNodeFactory implements INodeFactory {
+    void init() {
+    }
 
-      /**
-       * Function called by the dependency manager when at least one dependency
-       * become unsatisfied or when the component is shutting down because for
-       * example bundle is being stopped.
-       *
-       */
-      void destroy() {
-      }
+    /**
+     * Function called by the dependency manager when at least one dependency
+     * become unsatisfied or when the component is shutting down because for
+     * example bundle is being stopped.
+     *
+     */
+    void destroy() {
+    }
 
-      /**
-       * Function called by dependency manager after "init ()" is called and after
-       * the services provided by the class are registered in the service registry
-       *
-       */
-      void start() {
-      }
+    /**
+     * Function called by dependency manager after "init ()" is called and after
+     * the services provided by the class are registered in the service registry
+     *
+     */
+    void start() {
+    }
 
-      /**
-       * Function called by the dependency manager before the services exported by
-       * the component are unregistered, this will be followed by a "destroy ()"
-       * calls
-       *
-       */
-      void stop() {
-      }
+    /**
+     * Function called by the dependency manager before the services exported by
+     * the component are unregistered, this will be followed by a "destroy ()"
+     * calls
+     *
+     */
+    void stop() {
+    }
 
-      public Node fromString(String nodeType, String nodeId){
-          if(nodeType.equals("STUB"))
-              try{
-                  return new Node("STUB", Integer.parseInt(nodeId));
-              } catch(ConstructionException e)
-              {
-                  return null;
-              }
-          return null;
-      }
+    public Node fromString(String nodeType, String nodeId){
+        if(nodeType.equals("STUB")) {
+            try {
+                return new Node("STUB", Integer.parseInt(nodeId));
+            } catch(ConstructionException e) {
+                return null;
+            }
+        }
+        return null;
+    }
 }
index 5a637b7..c73607a 100644 (file)
@@ -103,7 +103,9 @@ public class ConnectionService implements IPluginOutConnectionService, IConnecti
 
     @Override
     public ConnectionLocality getLocalityStatus(Node node) {
-        if (this.connectionListener == null) return ConnectionLocality.NOT_CONNECTED;
+        if (this.connectionListener == null) {
+            return ConnectionLocality.NOT_CONNECTED;
+        }
         return connectionListener.getLocalityStatus(node);
     }
 
@@ -133,7 +135,9 @@ public class ConnectionService implements IPluginOutConnectionService, IConnecti
     @Override
     public Status disconnect(Node node) {
         IPluginInConnectionService s = pluginService.get(node.getType());
-        if (s != null) return s.disconnect(node);
+        if (s != null) {
+            return s.disconnect(node);
+        }
         return new Status(StatusCode.NOTFOUND);
     }
 
index 77d03aa..e7b261c 100644 (file)
@@ -176,17 +176,19 @@ public class ConfigManager implements IConfigManager{
 
     @Override
     public boolean memberExists(String name, String poolName) {
-        if(this.pools.containsKey(poolName)){
-            if(this.pools.get(poolName).getMember(name) != null )
+        if (this.pools.containsKey(poolName)) {
+            if (this.pools.get(poolName).getMember(name) != null) {
                 return true;
+            }
         }
         return false;
     }
 
     @Override
-    public boolean memberExists(String name, String memberIP,String poolName){
-        if(!this.pools.containsKey(poolName))
+    public boolean memberExists(String name, String memberIP,String poolName) {
+        if (!this.pools.containsKey(poolName)) {
             return false;
+        }
 
         return this.pools.get(poolName).poolMemberExists(new PoolMember(name, memberIP, poolName));
     }
index e1a997b..b4836e9 100644 (file)
@@ -146,8 +146,9 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager {
      * requires
      */
     public String getContainerName() {
-        if (containerName == null)
+        if (containerName == null) {
             return GlobalConstants.DEFAULT.toString();
+        }
         return containerName;
     }
 
index 3f6ac4a..e7394f9 100644 (file)
@@ -278,7 +278,9 @@ public class UserManager implements IUserManager, IObjectReader,
     private String checkPasswordRecovery() {
         final String fileDescription = "Default Network Administrator password recovery file";
         File recoveryFile = new File(UserManager.RECOVERY_FILE);
-        if (!recoveryFile.exists()) return null;
+        if (!recoveryFile.exists()) {
+            return null;
+        }
         // read the recovery file
         String pwd = null;
         try {
index faede10..3d633b6 100644 (file)
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
     </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>clustering.services</artifactId>
@@ -90,6 +94,7 @@
               javax.servlet.resources,
               javax.xml.parsers,
               javax.xml.transform,
+              org.apache.commons.io,
               org.apache.commons.logging,
               org.apache.taglibs.standard.functions,
               org.apache.taglibs.standard.resources,
index ca37f4b..090efec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2013, 2014 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -9,6 +9,7 @@
 package org.opendaylight.controller.web;
 
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
@@ -18,6 +19,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import org.apache.commons.io.IOUtils;
 import org.opendaylight.controller.configuration.IConfigurationContainerService;
 import org.opendaylight.controller.configuration.IConfigurationService;
 import org.opendaylight.controller.containermanager.IContainerAuthorization;
@@ -65,11 +67,17 @@ public class DaylightWeb {
     @ResponseBody
     public String getVersion(HttpServletRequest request, @PathVariable("property") String property) {
         Properties prop = new Properties();
+        FileInputStream propertiesFile = null;
         try {
-            prop.load(new FileInputStream("version.properties"));
+            propertiesFile = new FileInputStream("version.properties");
+            prop.load(propertiesFile);
             return prop.getProperty(property+".version");
-        } catch (Exception e) {
+        } catch (IOException e) {
+            // TODO: We should be logging the exception here
+            //       "Failed to open version.properties."
             return null;
+        } finally {
+            IOUtils.closeQuietly(propertiesFile);
         }
     }
     @RequestMapping(value = "web.json")
index 3eae432..fc515e1 100644 (file)
@@ -359,8 +359,9 @@ public abstract class BitBufferHelper {
         int value = 0;
         for (int i = 0; i < length; i++) {
             value = array[i];
-            if (value < 0)
+            if (value < 0) {
                 value += 256;
+            }
             ret = ret
                     | (long) ((long) value << ((length - i - 1) * NetUtils.NumBitsInAByte));
         }
@@ -390,8 +391,9 @@ public abstract class BitBufferHelper {
 
         for (int i = startOffset; i < array.length; i++) {
             value = array[i];
-            if (value < 0)
+            if (value < 0) {
                 value += 256;
+            }
             ret = ret
                     | (long) ((long) value << ((array.length - i - 1) * NetUtils.NumBitsInAByte));
         }
@@ -637,8 +639,9 @@ public abstract class BitBufferHelper {
             }
         } else {
             for (i = 0; i < numBytes; i++) {
-                if (i != 0)
+                if (i != 0) {
                     InputLSBbits = (inputdata[i - 1] & getLSBMask(extraOffsetBits));
+                }
                 InputMSBbits = (byte) (inputdata[i] & (getMSBMask(NetUtils.NumBitsInAByte
                         - extraOffsetBits)));
                 InputMSBbits = (InputMSBbits >= 0) ? InputMSBbits
@@ -648,16 +651,18 @@ public abstract class BitBufferHelper {
                 InputMSBbits = InputLSBbits = 0;
             }
             if (RestBits < (NetUtils.NumBitsInAByte - extraOffsetBits)) {
-                if (numBytes != 0)
+                if (numBytes != 0) {
                     InputLSBbits = (inputdata[i - 1] & getLSBMask(extraOffsetBits));
+                }
                 InputMSBbits = (byte) (inputdata[i] & (getMSBMask(RestBits)));
                 InputMSBbits = (InputMSBbits >= 0) ? InputMSBbits
                         : InputMSBbits + 256;
                 data[startByteOffset + i] = (byte) ((data[startByteOffset + i])
                         | (InputLSBbits << (NetUtils.NumBitsInAByte - extraOffsetBits)) | (InputMSBbits >> extraOffsetBits));
             } else if (RestBits == (NetUtils.NumBitsInAByte - extraOffsetBits)) {
-                if (numBytes != 0)
+                if (numBytes != 0) {
                     InputLSBbits = (inputdata[i - 1] & getLSBMask(extraOffsetBits));
+                }
                 InputMSBbits = (byte) (inputdata[i] & (getMSBMask(NetUtils.NumBitsInAByte
                         - extraOffsetBits)));
                 InputMSBbits = (InputMSBbits >= 0) ? InputMSBbits
@@ -665,8 +670,9 @@ public abstract class BitBufferHelper {
                 data[startByteOffset + i] = (byte) (data[startByteOffset + i]
                         | (InputLSBbits << (NetUtils.NumBitsInAByte - extraOffsetBits)) | (InputMSBbits >> extraOffsetBits));
             } else {
-                if (numBytes != 0)
+                if (numBytes != 0) {
                     InputLSBbits = (inputdata[i - 1] & getLSBMask(extraOffsetBits));
+                }
                 InputMSBbits = (byte) (inputdata[i] & (getMSBMask(NetUtils.NumBitsInAByte
                         - extraOffsetBits)));
                 InputMSBbits = (InputMSBbits >= 0) ? InputMSBbits
index d617c05..cf56aeb 100644 (file)
@@ -74,18 +74,23 @@ abstract public class DataLinkAddress implements Serializable {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         DataLinkAddress other = (DataLinkAddress) obj;
         if (name == null) {
-            if (other.name != null)
+            if (other.name != null) {
                 return false;
-        } else if (!name.equals(other.name))
+            }
+        } else if (!name.equals(other.name)) {
             return false;
+        }
         return true;
     }
 
index b7b72cb..8c5f8b9 100644 (file)
@@ -99,15 +99,19 @@ public class EthernetAddress extends DataLinkAddress {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (!super.equals(obj))
+        }
+        if (!super.equals(obj)) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         EthernetAddress other = (EthernetAddress) obj;
-        if (!Arrays.equals(macAddress, other.macAddress))
+        if (!Arrays.equals(macAddress, other.macAddress)) {
             return false;
+        }
         return true;
     }
 
index 3380a10..b09017f 100644 (file)
@@ -84,7 +84,7 @@ public class JmxAttributeValidationException extends RuntimeException {
 
     public static void checkCondition(boolean condition, String message,
             JmxAttribute jmxAttribute) throws JmxAttributeValidationException {
-        if (condition == false) {
+        if (!condition) {
             throw new JmxAttributeValidationException(
                     jmxAttribute.getAttributeName() + " " + message,
                     jmxAttribute);
index ee23206..0c7478d 100644 (file)
@@ -128,7 +128,7 @@ public class ObjectNameUtil {
         if (quoted == null) {
             throw new IllegalArgumentException("Cannot find " + SERVICE_QNAME_KEY + " in " + objectName);
         }
-        if (quoted.startsWith("\"") == false || quoted.endsWith("\"") == false) {
+        if (!quoted.startsWith("\"") || !quoted.endsWith("\"")) {
             throw new IllegalArgumentException("Quotes not found in " + objectName);
         }
         String substring = quoted.substring(1);
@@ -201,7 +201,7 @@ public class ObjectNameUtil {
             throw new IllegalArgumentException(
                     "Expected ObjectName with transaction:" + inputON);
         }
-        if (ON_DOMAIN.equals(inputON.getDomain()) == false) {
+        if (!ON_DOMAIN.equals(inputON.getDomain())) {
             throw new IllegalArgumentException("Expected different domain: "
                     + inputON);
         }
@@ -263,7 +263,7 @@ public class ObjectNameUtil {
         Map<String, String> allProperties = getAdditionalProperties(on);
         Map<String, String> result = new HashMap<>();
         for (Entry<String, String> entry : allProperties.entrySet()) {
-            if (blacklist.contains(entry.getKey()) == false) {
+            if (!blacklist.contains(entry.getKey())) {
                 result.put(entry.getKey(), entry.getValue());
             }
         }
index 93a6168..96739fb 100644 (file)
@@ -196,7 +196,6 @@ public class ConfigRegistryImpl implements AutoCloseable, ConfigRegistryImplMXBe
      * {@inheritDoc}
      */
     @Override
-    @SuppressWarnings("PMD.AvoidCatchingThrowable")
     public synchronized CommitStatus commitConfig(ObjectName transactionControllerON)
             throws ConflictingVersionException, ValidationException {
         final String transactionName = ObjectNameUtil
index d868f7c..de367ea 100644 (file)
@@ -49,8 +49,6 @@ import org.opendaylight.controller.config.spi.Module;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static java.lang.String.format;
-
 /**
  * Contains common code for readable/rw dynamic mbean wrappers. Routes all
  * requests (getAttribute, setAttribute, invoke) into the actual instance, but
index 7badc4b..8bd4208 100644 (file)
@@ -52,8 +52,9 @@ public class XmlFileStorageAdapter implements StorageAdapter, Persister {
             LOG.debug("Storage file does not exist, creating empty file");
             try {
                 boolean result = storage.createNewFile();
-                if (result == false)
+                if (result == false) {
                     throw new RuntimeException("Unable to create storage file " + storage);
+                }
             } catch (IOException e) {
                 throw new RuntimeException("Unable to create storage file " + storage, e);
             }
index 354c8c0..e629d20 100644 (file)
@@ -65,8 +65,9 @@ public final class Config {
     }
 
     public static Config fromXml(File from) {
-        if(isEmpty(from))
+        if(isEmpty(from)) {
             return new Config();
+        }
 
         try {
             JAXBContext jaxbContext = JAXBContext.newInstance(Config.class);
index 8111136..720f33d 100644 (file)
@@ -106,8 +106,9 @@ public class LogbackStatusListener implements StatusListener, LogbackRuntimeMXBe
 
     @Override
     public void close() throws IOException {
-        if (reg != null)
+        if (reg != null) {
             reg.close();
+        }
         unregisterFromLogback();
     }
 
index 93a08da..f460cb0 100644 (file)
@@ -11,10 +11,8 @@ package org.opendaylight.controller.config.threadpool.util;
 import com.google.common.eventbus.AsyncEventBus;
 import com.google.common.eventbus.DeadEvent;
 import com.google.common.eventbus.Subscribe;
-
 import java.io.Closeable;
 import java.io.IOException;
-
 import org.opendaylight.controller.config.threadpool.ThreadPool;
 import org.opendaylight.controller.config.yang.threadpool.impl.AsyncEventBusRuntimeMXBean;
 import org.opendaylight.controller.config.yang.threadpool.impl.AsyncEventBusRuntimeRegistration;
index b6dd77d..b56f0e4 100644 (file)
@@ -8,16 +8,14 @@
 
 package org.opendaylight.controller.config.threadpool.util;
 
+import com.google.common.eventbus.DeadEvent;
+import com.google.common.eventbus.EventBus;
+import com.google.common.eventbus.Subscribe;
 import java.io.Closeable;
-
 import org.opendaylight.controller.config.yang.threadpool.impl.EventBusRuntimeMXBean;
 import org.opendaylight.controller.config.yang.threadpool.impl.EventBusRuntimeRegistration;
 import org.opendaylight.controller.config.yang.threadpool.impl.EventBusRuntimeRegistrator;
 
-import com.google.common.eventbus.DeadEvent;
-import com.google.common.eventbus.EventBus;
-import com.google.common.eventbus.Subscribe;
-
 /**
  * Closeable {@link EventBus}.
  */
index 5036399..d013a0a 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.controller.config.threadpool.util;
 
+import com.google.common.base.Optional;
 import java.io.Closeable;
 import java.io.IOException;
 import java.util.concurrent.BlockingQueue;
@@ -19,11 +20,8 @@ import java.util.concurrent.RejectedExecutionHandler;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
-
 import org.opendaylight.controller.config.threadpool.ThreadPool;
 
-import com.google.common.base.Optional;
-
 /**
  * Implementation of {@link ThreadPool} using flexible number of threads wraps
  * {@link ExecutorService}.
index 2e27d6c..608d3a5 100644 (file)
@@ -8,15 +8,13 @@
 
 package org.opendaylight.controller.config.threadpool.util;
 
+import com.google.common.base.Preconditions;
 import java.io.Closeable;
 import java.io.IOException;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.atomic.AtomicLong;
-
 import javax.annotation.concurrent.ThreadSafe;
 
-import com.google.common.base.Preconditions;
-
 /**
  * Implementation of {@link ThreadFactory}.
  */
index 6d0449c..ed3ede0 100644 (file)
@@ -7,6 +7,13 @@
  */
 package org.opendaylight.controller.config.threadpool.eventbus;
 
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.ObjectName;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.config.api.ConflictingVersionException;
@@ -17,14 +24,6 @@ import org.opendaylight.controller.config.manager.impl.factoriesresolver.Hardcod
 import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
 import org.opendaylight.controller.config.yang.threadpool.impl.EventBusModuleFactory;
 
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.ObjectName;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-
 public class SyncEventBusConfigBeanTest extends AbstractConfigTest {
 
     private EventBusModuleFactory factory;
index f968e28..64e83a5 100644 (file)
@@ -36,7 +36,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class FixedThreadPoolConfigBeanTest extends AbstractConfigTest {
-    private static final Logger logger = LoggerFactory.getLogger(FixedThreadPoolConfigBeanTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(FixedThreadPoolConfigBeanTest.class);
 
     private FixedThreadPoolModuleFactory factory;
     private final String nameInstance = "fixedInstance";
@@ -107,7 +107,7 @@ public class FixedThreadPoolConfigBeanTest extends AbstractConfigTest {
                 result++;
             }
         }
-        logger.info("Current threads {}", names);
+        LOG.info("Current threads {}", names);
         return result;
     }
 
index 03cf9d6..d617126 100644 (file)
@@ -12,7 +12,6 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 
 import java.util.concurrent.ExecutorService;
-
 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.manager.impl.AbstractMockedModule;
index 9ae721e..e40a0cb 100644 (file)
@@ -7,6 +7,13 @@
  */
 package org.opendaylight.controller.config.threadpool.flexible;
 
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.ObjectName;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.config.api.ConflictingVersionException;
@@ -20,14 +27,6 @@ import org.opendaylight.controller.config.yang.threadpool.impl.NamingThreadFacto
 import org.opendaylight.controller.config.yang.threadpool.impl.flexible.FlexibleThreadPoolModuleFactory;
 import org.opendaylight.controller.config.yang.threadpool.impl.flexible.FlexibleThreadPoolModuleMXBean;
 
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.InstanceNotFoundException;
-import javax.management.ObjectName;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-
 public class FlexibleThreadPoolConfigBeanTest extends AbstractConfigTest {
 
     private FlexibleThreadPoolModuleFactory flexibleFactory;
index 2ba1b3b..157380d 100644 (file)
@@ -7,7 +7,18 @@
  */
 package org.opendaylight.controller.config.threadpool.scheduled;
 
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.Matchers.anyLong;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+
 import com.google.common.util.concurrent.ListenableFutureTask;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+import javax.management.ObjectName;
 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.manager.impl.AbstractMockedModule;
@@ -16,18 +27,6 @@ import org.opendaylight.controller.config.threadpool.util.ScheduledThreadPoolWra
 import org.opendaylight.controller.config.yang.threadpool.ScheduledThreadPoolServiceInterface;
 import org.opendaylight.controller.config.yang.threadpool.impl.scheduled.ScheduledThreadPoolModuleMXBean;
 
-import javax.management.ObjectName;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyBoolean;
-import static org.mockito.Matchers.anyLong;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-
 public class TestingScheduledThreadPoolModule extends AbstractMockedModule implements
         ScheduledThreadPoolServiceInterface, Module, ScheduledThreadPoolModuleMXBean {
 
index 7505fcf..9f5498c 100644 (file)
@@ -7,6 +7,10 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.it;
 
+import static org.junit.Assert.fail;
+
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.ObjectName;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -21,11 +25,6 @@ import org.opendaylight.controller.config.yang.test.impl.DtoB;
 import org.opendaylight.controller.config.yang.test.impl.TestImplModuleFactory;
 import org.opendaylight.controller.config.yang.test.impl.TestImplModuleMXBean;
 
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.ObjectName;
-
-import static org.junit.Assert.fail;
-
 @Ignore
 // ietf beans are not JMX compliant beans:
 // Do not know how to make a
index cd0f491..a1ccdc3 100644 (file)
@@ -9,6 +9,16 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin;
 
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
 import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry;
 import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
@@ -28,20 +38,9 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUti
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
 final class CodeWriter {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(CodeWriter.class);
+    private static final Logger LOG = LoggerFactory.getLogger(CodeWriter.class);
     private static final Optional<String> COPYRIGHT = StringUtil.loadCopyright();
 
     public File writeSie(ServiceInterfaceEntry sie, File outputBaseDir) {
@@ -52,7 +51,7 @@ final class CodeWriter {
         } catch (Exception e) {
             String message = "An error occurred during Service interface generating, sie:"
                     + sie.getTypeName() + ", " + sie.getFullyQualifiedName();
-            LOGGER.error(message, e);
+            LOG.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -113,7 +112,7 @@ final class CodeWriter {
         } catch (Exception e) {
             String message = "An error occurred during Module generating, mbe:"
                     + mbe.getJavaNamePrefix();
-            LOGGER.error(message, e);
+            LOG.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
index c835627..9ad8d28 100644 (file)
@@ -12,6 +12,16 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.project.MavenProject;
@@ -30,17 +40,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.impl.StaticLoggerBinder;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
 /**
  * This class interfaces with yang-maven-plugin. Gets parsed yang modules in
  * {@link SchemaContext}, and parameters form the plugin configuration, and
@@ -54,7 +53,7 @@ public class JMXGenerator implements CodeGenerator {
 
     private PackageTranslator packageTranslator;
     private final CodeWriter codeWriter;
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(JMXGenerator.class);
     private Map<String, String> namespaceToPackageMapping;
     private File resourceBaseDir;
@@ -167,7 +166,7 @@ public class JMXGenerator implements CodeGenerator {
                         fullyQualifiedNamesOfFactories.toString());
             } catch (IOException e) {
                 String message = "Cannot write to " + serviceLoaderFile;
-                LOGGER.error(message);
+                LOG.error(message);
                 throw new RuntimeException(message, e);
             }
         }
@@ -185,8 +184,8 @@ public class JMXGenerator implements CodeGenerator {
 
     @Override
     public void setAdditionalConfig(Map<String, String> additionalCfg) {
-        if (LOGGER != null) {
-            LOGGER.debug(getClass().getCanonicalName(),
+        if (LOG != null) {
+            LOG.debug(getClass().getCanonicalName(),
                     ": Additional configuration received: ",
                     additionalCfg.toString());
         }
@@ -254,9 +253,10 @@ public class JMXGenerator implements CodeGenerator {
     public void setMavenProject(MavenProject project) {
         this.projectBaseDir = project.getBasedir();
 
-        if (LOGGER != null)
-            LOGGER.debug(getClass().getCanonicalName(), " project base dir: ",
+        if (LOG != null) {
+            LOG.debug(getClass().getCanonicalName(), " project base dir: ",
                     projectBaseDir);
+        }
     }
 
     @VisibleForTesting
@@ -272,7 +272,7 @@ public class JMXGenerator implements CodeGenerator {
                     }
                 }
                 if (undeletedFiles.isEmpty() == false) {
-                    LOGGER.error(
+                    LOG.error(
                             "Illegal state occurred: Unable to delete already generated files, undeleted files: {}",
                             undeletedFiles);
                 }
index c3a00b9..52b6bc1 100644 (file)
@@ -8,15 +8,14 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
 import com.google.common.collect.Lists;
+import java.util.Collections;
+import java.util.List;
 import org.opendaylight.controller.config.spi.ModuleFactory;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
 
-import java.util.Collections;
-import java.util.List;
-
 public class AbstractFactoryTemplate extends GeneralClassTemplate {
 
     private static final List<String> IMPLEMENTED_IFCS = Lists
index a959978..edcd11d 100644 (file)
@@ -9,6 +9,8 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
+import java.util.Collections;
+import java.util.List;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
@@ -17,9 +19,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Meth
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.TypeDeclaration;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.FullyQualifiedNameHelper;
 
-import java.util.Collections;
-import java.util.List;
-
 public abstract class AbstractFtlTemplate implements FtlTemplate {
     private final String packageName;
     private final List<Field> fields;
index 92a71c2..2402014 100644 (file)
@@ -7,15 +7,14 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
+import java.util.Collections;
+import java.util.List;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.ModuleField;
 
-import java.util.Collections;
-import java.util.List;
-
 public class AbstractModuleTemplate extends GeneralClassTemplate {
 
     private final List<ModuleField> moduleFields;
index d01f3f9..2e867d3 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
 import com.google.common.base.Optional;
+import java.util.List;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
@@ -15,8 +16,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Head
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Method;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.TypeDeclaration;
 
-import java.util.List;
-
 public interface FtlTemplate {
 
     Header getHeader();
index 4df7b2a..3f4917f 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
 import java.util.Collections;
 import java.util.List;
-
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
@@ -39,9 +38,10 @@ public class GeneralClassTemplate extends AbstractFtlTemplate {
     }
 
     static List<String> checkCardinality(List<String> extendedClass) {
-        if (extendedClass.size() > 1)
+        if (extendedClass.size() > 1) {
             throw new IllegalArgumentException(
                     "Class cannot have more than one super " + "class");
+        }
         return extendedClass;
     }
 
index 1539e10..6842ed1 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
 import java.util.Collections;
 import java.util.List;
-
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDeclaration;
index aa69645..13345d6 100644 (file)
@@ -11,6 +11,8 @@ import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkState;
 import static java.lang.String.format;
 
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.collect.Lists;
 import java.io.Closeable;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -24,7 +26,6 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
-
 import org.opendaylight.controller.config.api.runtime.HierarchicalRuntimeBeanRegistration;
 import org.opendaylight.controller.config.api.runtime.RootRuntimeBeanRegistrator;
 import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry;
@@ -34,9 +35,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Fiel
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.FullyQualifiedNameHelper;
 
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.collect.Lists;
-
 public class RuntimeRegistratorFtlTemplate extends GeneralClassTemplate {
 
     private RuntimeRegistratorFtlTemplate(RuntimeBeanEntry runtimeBeanEntry,
@@ -44,7 +42,7 @@ public class RuntimeRegistratorFtlTemplate extends GeneralClassTemplate {
         // TODO header
         super(null, runtimeBeanEntry.getPackageName(), name, Collections
                 .<String> emptyList(), Arrays.asList(Closeable.class
-                .getCanonicalName()), fields, methods);
+                    .getCanonicalName()), fields, methods);
     }
 
     public static RuntimeBeanEntry findRoot(
index 5d2d664..1dd23a1 100644 (file)
@@ -8,12 +8,11 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 
 import com.google.common.collect.Lists;
+import java.util.Collections;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
 
-import java.util.Collections;
-
 public class StubFactoryTemplate extends GeneralClassTemplate {
 
     public StubFactoryTemplate(Header header, String packageName, String name,
index ca1e823..53ab4ef 100644 (file)
@@ -10,6 +10,14 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import javax.management.openmbean.SimpleType;
 import org.opendaylight.controller.config.api.DependencyResolver;
 import org.opendaylight.controller.config.api.IdentityAttributeRef;
 import org.opendaylight.controller.config.api.RuntimeBeanRegistratorAwareModule;
@@ -44,15 +52,6 @@ import org.opendaylight.yangtools.binding.generator.util.BindingGeneratorUtil;
 import org.opendaylight.yangtools.sal.binding.model.api.ParameterizedType;
 import org.opendaylight.yangtools.sal.binding.model.api.Type;
 
-import javax.management.openmbean.SimpleType;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
 public class TemplateFactory {
 
     /**
@@ -167,10 +166,11 @@ public class TemplateFactory {
                 Lists.<MethodDeclaration> newArrayList());
         sieTemplate.setJavadoc(sie.getNullableDescription());
 
-        if (sie.getNullableDescription() != null)
+        if (sie.getNullableDescription() != null) {
             sieTemplate.getAnnotations().add(
                     Annotation.createDescriptionAnnotation(sie
                             .getNullableDescription()));
+        }
         sieTemplate.getAnnotations().addAll(Annotation.createSieAnnotations(sie));
 
         return sieTemplate;
@@ -224,10 +224,11 @@ public class TemplateFactory {
                 attrProcessor.getMethods(), generateRuntime,
                 registratorFullyQualifiedName);
 
-        if (mbe.getNullableDescription() != null)
+        if (mbe.getNullableDescription() != null) {
             abstractModuleTemplate.getAnnotations().add(
                     Annotation.createDescriptionAnnotation(mbe
                             .getNullableDescription()));
+        }
         return abstractModuleTemplate;
     }
 
@@ -688,8 +689,9 @@ public class TemplateFactory {
 
 
     private static boolean needsDepResolver(AttributeIfc value) {
-        if(value instanceof TOAttribute)
+        if(value instanceof TOAttribute) {
             return true;
+        }
         if(value instanceof ListAttribute) {
             AttributeIfc innerAttribute = ((ListAttribute) value).getInnerAttribute();
             return needsDepResolver(innerAttribute);
index a8ddabc..ae5f947 100644 (file)
@@ -9,19 +9,18 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
-import org.opendaylight.controller.config.api.annotations.Description;
-import org.opendaylight.controller.config.api.annotations.RequireInterface;
-import org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnotation;
-import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
-import org.opendaylight.yangtools.yang.binding.annotations.ModuleQName;
-import org.opendaylight.yangtools.yang.common.QName;
-
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import org.opendaylight.controller.config.api.annotations.Description;
+import org.opendaylight.controller.config.api.annotations.RequireInterface;
+import org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnotation;
+import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
+import org.opendaylight.yangtools.yang.binding.annotations.ModuleQName;
+import org.opendaylight.yangtools.yang.common.QName;
 
 public class Annotation {
     final String name;
index 3639b6d..312bb4a 100644 (file)
@@ -7,12 +7,11 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model;
 
-import com.google.common.collect.Lists;
+import static com.google.common.base.Preconditions.checkNotNull;
 
+import com.google.common.collect.Lists;
 import java.util.List;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-
 public class Field {
     private final String type;
     private final String name;
index eb07c80..89a2cf7 100644 (file)
@@ -8,9 +8,8 @@
 
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model;
 
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator;
-
 import java.util.Date;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator;
 
 public class HeaderSerializer {
     private static final String GENERATOR_CLASS = JMXGenerator.class.getCanonicalName();
index 37d6603..7dc864b 100644 (file)
@@ -8,11 +8,10 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model;
 
 
-import org.opendaylight.controller.config.yangjmxgenerator.attribute.Dependency;
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import org.opendaylight.controller.config.yangjmxgenerator.attribute.Dependency;
 
 public class ModuleField extends Field {
 
index a5bb987..1c44040 100644 (file)
@@ -7,9 +7,8 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model;
 
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.TypeName;
-
 import java.util.List;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.TypeName;
 
 public class TypeDeclaration {
     private final String type, name;
index 2378fac..64a13d3 100644 (file)
@@ -89,7 +89,7 @@ public class AbsModuleGeneratedObjectFactory {
         }
 
         // add logger:
-        b.addToBody(getLogger(abstractFQN));
+        b.addToBody(getLoggerDefinition(abstractFQN));
 
         b.addToBody("//attributes start");
         for(ModuleField moduleField: moduleFields) {
@@ -377,7 +377,7 @@ public class AbsModuleGeneratedObjectFactory {
         return result;
     }
 
-    private static String getLogger(FullyQualifiedName fqn) {
+    private static String getLoggerDefinition(FullyQualifiedName fqn) {
         return format("private static final %s logger = %s.getLogger(%s.class);",
                 Logger.class.getCanonicalName(), LoggerFactory.class.getCanonicalName(), fqn);
     }
index 051b1a7..68dd704 100644 (file)
@@ -1,7 +1,8 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory;
 
+import com.google.common.base.Joiner;
+import com.google.common.base.Optional;
 import java.util.LinkedHashMap;
-
 import org.opendaylight.controller.config.api.DependencyResolver;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
@@ -11,9 +12,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.Generated
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.JavaFileInputBuilder;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.TypeName;
 
-import com.google.common.base.Joiner;
-import com.google.common.base.Optional;
-
 public class ConcreteModuleGeneratedObjectFactory {
 
     public GeneratedObject toGeneratedObject(ModuleMXBeanEntry mbe, Optional<String> copyright, Optional<String> header) {
index f72551a..5572bff 100644 (file)
@@ -1,11 +1,11 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.java;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+
 import java.io.File;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-
 public class FullyQualifiedName {
 
     private final String packageName;
index 4ad080c..4d8bd3e 100644 (file)
@@ -1,15 +1,14 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.java;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+
 import com.google.common.base.Optional;
 import com.google.common.collect.Maps;
-import org.apache.commons.io.FileUtils;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil;
-
 import java.io.File;
 import java.io.IOException;
 import java.util.Map.Entry;
-
-import static com.google.common.base.Preconditions.checkNotNull;
+import org.apache.commons.io.FileUtils;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil;
 
 public class GeneratedObject {
 
index 72819db..336bece 100644 (file)
@@ -1,10 +1,10 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.java;
 
+import static org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil.prefixAndJoin;
+
 import com.google.common.base.Optional;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil;
 
-import static org.opendaylight.controller.config.yangjmxgenerator.plugin.util.StringUtil.prefixAndJoin;
-
 public class GeneratedObjectBuilder {
     private final JavaFileInput input;
 
index c739f57..588e218 100644 (file)
@@ -8,14 +8,13 @@
 
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.java;
 
-import com.google.common.base.Optional;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation;
+import static com.google.common.base.Preconditions.checkNotNull;
 
+import com.google.common.base.Optional;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-
-import static com.google.common.base.Preconditions.checkNotNull;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation;
 
 public class JavaFileInputBuilder {
 
index bcc55a2..536dc2f 100644 (file)
@@ -4,16 +4,15 @@ import com.google.common.base.Joiner;
 import com.google.common.base.Optional;
 import com.google.common.base.Splitter;
 import com.google.common.base.Strings;
+import java.util.List;
+import java.util.regex.Pattern;
 import org.apache.commons.lang3.StringUtils;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.List;
-import java.util.regex.Pattern;
-
 public class StringUtil {
-    private static final Logger logger = LoggerFactory.getLogger(StringUtils.class);
+    private static final Logger LOG = LoggerFactory.getLogger(StringUtil.class);
 
     /**
      * @param list   of strings to be joined by ','
@@ -66,7 +65,7 @@ public class StringUtil {
                     return Optional.of(IOUtils.toString(in));
                 }
             } catch (IOException e) {
-                logger.warn("Cannot load copyright.txt", e);
+                LOG.warn("Cannot load copyright.txt", e);
             }
 
         */
index 1dde94b..2eae8b6 100644 (file)
@@ -7,12 +7,11 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin;
 
+import java.io.File;
 import org.apache.commons.io.FileUtils;
 import org.junit.Before;
 import org.opendaylight.controller.config.yangjmxgenerator.AbstractYangTest;
 
-import java.io.File;
-
 public abstract class AbstractGeneratorTest extends AbstractYangTest {
     private static final File GENERATOR_OUTPUT_PATH_ROOT = new File(
             "target/testgen");
index cdff509..3a820fd 100644 (file)
@@ -13,12 +13,11 @@ import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import com.google.common.collect.Sets;
 import org.junit.Test;
 import org.opendaylight.controller.config.yangjmxgenerator.ConfigConstants;
 import org.opendaylight.controller.config.yangjmxgenerator.PackageTranslatorTest;
 
-import com.google.common.collect.Sets;
-
 public class JMXGeneratorFileNamesValidationTest extends JMXGeneratorTest {
 
     @Test
index 4211201..8c2b5d6 100644 (file)
@@ -565,7 +565,7 @@ public class JMXGeneratorTest extends AbstractGeneratorTest {
 
     private static class SieASTVisitor extends ASTVisitor {
         protected String packageName, descriptionAnotValue, sieAnnotValue,
-                sieAnnotOsgiRegistrationType, type, extnds, javadoc;
+        sieAnnotOsgiRegistrationType, type, extnds, javadoc;
         protected Map<String, String> methodDescriptions = Maps.newHashMap();
 
         @Override
index 3c01cc0..076e4e9 100644 (file)
@@ -7,7 +7,14 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin;
 
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+
 import com.google.common.collect.Maps;
+import java.util.Collections;
+import java.util.Map;
 import org.junit.Test;
 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
 import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc;
@@ -16,14 +23,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.AbstractFa
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.TemplateFactory;
 import org.opendaylight.yangtools.sal.binding.model.api.Type;
 
-import java.util.Collections;
-import java.util.Map;
-
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-
 public class ModuleMXBeanEntryTemplatesTest {
 
     @Test
index f21765e..925f95a 100644 (file)
@@ -7,20 +7,19 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin;
 
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Map;
 import org.junit.Test;
 import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry;
 import org.opendaylight.controller.config.yangjmxgenerator.RuntimeRegistratorTest;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.FtlTemplate;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.RuntimeRegistratorFtlTemplate;
 
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Map;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-
 public class RuntimeRegistratorFtlFileTest extends RuntimeRegistratorTest {
 
     @Test
index 957fbf5..c3ca077 100644 (file)
@@ -8,6 +8,12 @@
 
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.module;
 
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
 import net.sourceforge.pmd.lang.Parser;
 import net.sourceforge.pmd.lang.ParserOptions;
 import net.sourceforge.pmd.lang.ast.Node;
@@ -17,15 +23,8 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.AbstractGenera
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 public class AbstractGeneratedObjectTest extends AbstractGeneratorTest {
-    private static final Logger logger = LoggerFactory.getLogger(AbstractGeneratedObjectTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(AbstractGeneratedObjectTest.class);
 
     protected void assertHasMethodNamed(Node c, String method) {
         assertTrue(c.hasDescendantMatchingXPath("//MethodDeclaration[MethodDeclarator[@Image='" +
@@ -35,7 +34,7 @@ public class AbstractGeneratedObjectTest extends AbstractGeneratorTest {
 
     protected Node parse(File dstFile) throws IOException {
         assertNotNull(dstFile);
-        logger.debug(FileUtils.readFileToString(dstFile));
+        LOG.debug(FileUtils.readFileToString(dstFile));
         Parser parser = new Java17Parser(new ParserOptions());
         return parser.parse(dstFile.toString(), new FileReader(dstFile));
     }
index 164d1a5..ba9f544 100644 (file)
@@ -9,6 +9,10 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.module.abs;
 
 import com.google.common.base.Optional;
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+import java.util.Map.Entry;
 import org.junit.Test;
 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
 import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
@@ -18,11 +22,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.Generated
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.module.AbstractGeneratedObjectTest;
 import org.opendaylight.yangtools.yang.common.QName;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-import java.util.Map.Entry;
-
 public class AbsModuleGeneratedObjectFactoryTest extends AbstractGeneratedObjectTest {
 
     @Test
index 519b0ed..a9bf2b2 100644 (file)
@@ -1,6 +1,12 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.module.concrete;
 
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+
 import com.google.common.base.Optional;
+import java.io.File;
+import java.util.Map.Entry;
 import net.sourceforge.pmd.lang.ast.Node;
 import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration;
 import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit;
@@ -11,13 +17,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQual
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.GeneratedObject;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.module.AbstractGeneratedObjectTest;
 
-import java.io.File;
-import java.util.Map.Entry;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-
 public class ConcreteModuleGeneratedObjectFactoryTest extends AbstractGeneratedObjectTest {
 
     @Test
index 1ad0207..1576b38 100644 (file)
@@ -1,15 +1,14 @@
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.util;
 
-import org.junit.Ignore;
-import org.junit.Test;
-import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName;
-
-import java.io.IOException;
-
 import static java.util.Arrays.asList;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.io.IOException;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.FullyQualifiedName;
+
 public class StringUtilTest {
     @Test
     public void testPrefixAndJoin() {
@@ -33,19 +32,19 @@ public class StringUtilTest {
     @Test
     public void testFormatting() {
         {
-        String input = "  \tpack;\n" +
+            String input = "  \tpack;\n" +
                 "class Bar{ \n" +
                 " method() {\n" +
                 "  body\n" +
                 "}\n" +
                 "  }";
-        String expected = "pack;\n" +
+            String expected = "pack;\n" +
                 "class Bar{\n" +
                 "    method() {\n" +
                 "        body\n" +
                 "    }\n" +
                 "}\n";
-        assertEquals(expected, StringUtil.formatJavaSource(input));
+            assertEquals(expected, StringUtil.formatJavaSource(input));
         }
         {
             String input = "{\n" +
index 979b396..bfeb3f0 100644 (file)
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>binding-type-provider</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-model-util</artifactId>
+    </dependency>
 
     <dependency>
       <groupId>org.opendaylight.yangtools</groupId>
index f99d378..ed727c9 100644 (file)
@@ -18,7 +18,6 @@ import com.google.common.base.Optional;
 import com.google.common.collect.Collections2;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
-
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -27,9 +26,7 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
-
 import javax.annotation.Nullable;
-
 import org.opendaylight.controller.config.yangjmxgenerator.attribute.AbstractDependencyAttribute;
 import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc;
 import org.opendaylight.controller.config.yangjmxgenerator.attribute.DependencyAttribute;
@@ -93,7 +90,7 @@ final class ModuleMXBeanEntryBuilder {
         return this;
     }
 
-    private static final Logger LOGGER = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(ModuleMXBeanEntryBuilder.class);
 
     // TODO: the XPath should be parsed by code generator IMO
@@ -108,7 +105,7 @@ final class ModuleMXBeanEntryBuilder {
 
 
     public Map<String, ModuleMXBeanEntry> build() {
-        LOGGER.debug("Generating ModuleMXBeans of {} to package {}",
+        LOG.debug("Generating ModuleMXBeans of {} to package {}",
                 currentModule.getNamespace(), packageName);
 
         String configModulePrefix;
@@ -146,7 +143,7 @@ final class ModuleMXBeanEntryBuilder {
         checkAttributeNamesUniqueness(uniqueGeneratedClassesNames, result);
         checkUnaugumentedIdentities(unaugmentedModuleIdentities);
 
-        LOGGER.debug("Number of ModuleMXBeans to be generated: {}", result.size());
+        LOG.debug("Number of ModuleMXBeans to be generated: {}", result.size());
 
         return result;
     }
@@ -166,7 +163,7 @@ final class ModuleMXBeanEntryBuilder {
 
     private static void checkUnaugumentedIdentities(final Map<String, IdentitySchemaNode> unaugmentedModuleIdentities) {
         if (unaugmentedModuleIdentities.size() > 0) {
-            LOGGER.warn("Augmentation not found for all currentModule identities: {}",
+            LOG.warn("Augmentation not found for all currentModule identities: {}",
                     unaugmentedModuleIdentities.keySet());
         }
     }
@@ -190,7 +187,7 @@ final class ModuleMXBeanEntryBuilder {
                             + identityLocalName);
                 } else {
                     moduleIdentities.put(identityLocalName, id);
-                    LOGGER.debug("Found identity {}", identityLocalName);
+                    LOG.debug("Found identity {}", identityLocalName);
                 }
                 // validation check on unknown schema nodes
                 boolean providedServiceWasSet = false;
@@ -271,12 +268,12 @@ final class ModuleMXBeanEntryBuilder {
         HAS_CHILDREN_AND_QNAME dataNodeContainer = getDataNodeContainer(choiceCaseNode);
 
         if (EXPECTED_CONFIGURATION_AUGMENTATION_SCHEMA_PATH.equals(augmentation.getTargetPath())) {
-            LOGGER.debug("Parsing configuration of {}", moduleLocalNameFromXPath);
+            LOG.debug("Parsing configuration of {}", moduleLocalNameFromXPath);
             yangToAttributes = fillConfiguration(dataNodeContainer, currentModule, typeProviderWrapper, qNamesToSIEs,
                     schemaContext, packageName);
             checkUniqueAttributesWithGeneratedClass(uniqueGeneratedClassesNames, when.getQName(), yangToAttributes);
         } else if (EXPECTED_STATE_AUGMENTATION_SCHEMA_PATH.equals(augmentation.getTargetPath())) {
-            LOGGER.debug("Parsing state of {}", moduleLocalNameFromXPath);
+            LOG.debug("Parsing state of {}", moduleLocalNameFromXPath);
             try {
                 runtimeBeans = fillRuntimeBeans(dataNodeContainer, currentModule, typeProviderWrapper, packageName,
                         moduleLocalNameFromXPath, javaNamePrefix);
@@ -309,9 +306,9 @@ final class ModuleMXBeanEntryBuilder {
                     " both state and configuration");
         } else {
             ModuleMXBeanEntry.ModuleMXBeanEntryInitial initial = new ModuleMXBeanEntry.ModuleMXBeanEntryInitialBuilder()
-            .setIdSchemaNode(moduleIdentity).setPackageName(packageName).setJavaNamePrefix(javaNamePrefix)
-            .setNamespace(currentModule.getNamespace().toString()).setqName(ModuleUtil.getQName(currentModule))
-            .build();
+                .setIdSchemaNode(moduleIdentity).setPackageName(packageName).setJavaNamePrefix(javaNamePrefix)
+                .setNamespace(currentModule.getNamespace().toString()).setqName(ModuleUtil.getQName(currentModule))
+                .build();
 
             // construct ModuleMXBeanEntry
             ModuleMXBeanEntry moduleMXBeanEntry = new ModuleMXBeanEntry(initial, yangToAttributes, providedServices,
@@ -377,7 +374,7 @@ final class ModuleMXBeanEntryBuilder {
             final String javaNamePrefix) {
 
         return RuntimeBeanEntry.extractClassNameToRuntimeBeanMap(packageName, dataNodeContainer, moduleLocalNameFromXPath,
-                typeProviderWrapper, javaNamePrefix, currentModule).values();
+                typeProviderWrapper, javaNamePrefix, currentModule, schemaContext).values();
 
     }
 
index aec4115..74981a9 100644 (file)
@@ -11,9 +11,14 @@ import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkState;
 
 import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Function;
 import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.HashMultimap;
 import com.google.common.collect.Lists;
-
+import com.google.common.collect.Multimap;
+import com.google.common.collect.Sets;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -21,12 +26,12 @@ import java.util.Comparator;
 import java.util.Deque;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
-
 import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc;
 import org.opendaylight.controller.config.yangjmxgenerator.attribute.JavaAttribute;
 import org.opendaylight.controller.config.yangjmxgenerator.attribute.ListAttribute;
@@ -38,15 +43,16 @@ import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
 import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.UsesNode;
+import org.opendaylight.yangtools.yang.model.util.SchemaContextUtil;
 
 /**
  * Holds information about runtime bean to be generated. There are two kinds of
@@ -58,6 +64,21 @@ import org.opendaylight.yangtools.yang.model.api.UsesNode;
  * lined via children so that a tree with all beans can be created.
  */
 public class RuntimeBeanEntry {
+
+    private static final Function<SchemaNode, QName> QNAME_FROM_NODE = new Function<SchemaNode, QName>() {
+        @Override
+        public QName apply(final SchemaNode input) {
+            return input.getQName();
+        }
+    };
+
+    private static final Function<UnknownSchemaNode, String> UNKNOWN_NODE_TO_STRING = new Function<UnknownSchemaNode, String>() {
+        @Override
+        public String apply(final UnknownSchemaNode input) {
+            return input.getQName().getLocalName() + input.getNodeParameter();
+        }
+    };
+
     private final String packageName;
     private final String yangName, javaNamePrefix;
     private final boolean isRoot;
@@ -114,13 +135,12 @@ public class RuntimeBeanEntry {
     public static Map<String, RuntimeBeanEntry> extractClassNameToRuntimeBeanMap(
             final String packageName, final DataNodeContainer container,
             final String moduleYangName, final TypeProviderWrapper typeProviderWrapper,
-            final String javaNamePrefix, final Module currentModule) {
+            final String javaNamePrefix, final Module currentModule, final SchemaContext schemaContext) {
 
-        Map<QName, Set<RpcDefinition>> identitiesToRpcs = getIdentitiesToRpcs(currentModule);
 
         AttributesRpcsAndRuntimeBeans attributesRpcsAndRuntimeBeans = extractSubtree(
                 packageName, container, typeProviderWrapper, currentModule,
-                identitiesToRpcs);
+                schemaContext);
         Map<String, RuntimeBeanEntry> result = new HashMap<>();
 
         List<AttributeIfc> attributes;
@@ -152,52 +172,41 @@ public class RuntimeBeanEntry {
         return result;
     }
 
-    private static Map<QName/* of identity */, Set<RpcDefinition>> getIdentitiesToRpcs(
-            final Module currentModule) {
-        // currently only looks for local identities (found in currentModule)
-        Map<QName, Set<RpcDefinition>> result = new HashMap<>();
-        for (IdentitySchemaNode identity : currentModule.getIdentities()) {
-            // add all
-            result.put(identity.getQName(), new HashSet<RpcDefinition>());
-        }
+    private static Multimap<QName/* of identity */, RpcDefinition> getIdentitiesToRpcs(
+            final SchemaContext schemaCtx) {
+        Multimap<QName, RpcDefinition> result = HashMultimap.create();
+        for (Module currentModule : schemaCtx.getModules()) {
 
-        for (RpcDefinition rpc : currentModule.getRpcs()) {
-            ContainerSchemaNode input = rpc.getInput();
-            if (input != null) {
-                for (UsesNode uses : input.getUses()) {
+            // Find all identities in current module for later identity->rpc mapping
+            Set<QName> allIdentitiesInModule = Sets.newHashSet(Collections2.transform(currentModule.getIdentities(), QNAME_FROM_NODE));
 
-                    if (uses.getGroupingPath().getPath().size() != 1) {
-                        continue;
-                    }
+            for (RpcDefinition rpc : currentModule.getRpcs()) {
+                ContainerSchemaNode input = rpc.getInput();
+                if (input != null) {
+                    for (UsesNode uses : input.getUses()) {
 
-                    // check grouping path
-                    QName qname = uses.getGroupingPath().getPath().get(0);
-                    if (false == qname
-                            .equals(ConfigConstants.RPC_CONTEXT_REF_GROUPING_QNAME)) {
-                        continue;
-                    }
+                        // Check if the rpc is config rpc by looking for input argument rpc-context-ref
+                        Iterator<QName> pathFromRoot = uses.getGroupingPath().getPathFromRoot().iterator();
+                        if (!pathFromRoot.hasNext() ||
+                                !pathFromRoot.next().equals(ConfigConstants.RPC_CONTEXT_REF_GROUPING_QNAME)) {
+                            continue;
+                        }
 
-                    for (SchemaNode refinedNode : uses.getRefines().values()) {
-
-                        for (UnknownSchemaNode unknownSchemaNode : refinedNode
-                                .getUnknownSchemaNodes()) {
-                            if (ConfigConstants.RPC_CONTEXT_INSTANCE_EXTENSION_QNAME
-                                    .equals(unknownSchemaNode.getNodeType())) {
-                                String localIdentityName = unknownSchemaNode
-                                        .getNodeParameter();
-                                QName identityQName = QName.create(
-                                        currentModule.getNamespace(),
-                                        currentModule.getRevision(),
-                                        localIdentityName);
-                                Set<RpcDefinition> rpcDefinitions = result
-                                        .get(identityQName);
-                                if (rpcDefinitions == null) {
-                                    throw new IllegalArgumentException(
-                                            "Identity referenced by rpc not found. Identity:"
-                                                    + localIdentityName + " , rpc "
-                                                    + rpc);
+                        for (SchemaNode refinedNode : uses.getRefines().values()) {
+                            for (UnknownSchemaNode unknownSchemaNode : refinedNode
+                                    .getUnknownSchemaNodes()) {
+                                if (ConfigConstants.RPC_CONTEXT_INSTANCE_EXTENSION_QNAME
+                                        .equals(unknownSchemaNode.getNodeType())) {
+                                    String localIdentityName = unknownSchemaNode
+                                            .getNodeParameter();
+                                    QName identityQName = QName.create(
+                                            currentModule.getNamespace(),
+                                            currentModule.getRevision(),
+                                            localIdentityName);
+                                    Preconditions.checkArgument(allIdentitiesInModule.contains(identityQName),
+                                            "Identity referenced by rpc not found. Identity: %s, rpc: %s", localIdentityName, rpc);
+                                    result.put(identityQName, rpc);
                                 }
-                                rpcDefinitions.add(rpc);
                             }
                         }
                     }
@@ -214,7 +223,9 @@ public class RuntimeBeanEntry {
     private static AttributesRpcsAndRuntimeBeans extractSubtree(
             final String packageName, final DataNodeContainer subtree,
             final TypeProviderWrapper typeProviderWrapper, final Module currentModule,
-            final Map<QName, Set<RpcDefinition>> identitiesToRpcs) {
+            final SchemaContext ctx) {
+
+        Multimap<QName, RpcDefinition> identitiesToRpcs = getIdentitiesToRpcs(ctx);
 
         List<AttributeIfc> attributes = Lists.newArrayList();
         List<RuntimeBeanEntry> runtimeBeanEntries = new ArrayList<>();
@@ -236,7 +247,7 @@ public class RuntimeBeanEntry {
                     ListSchemaNode listSchemaNode = (ListSchemaNode) child;
                     RuntimeBeanEntry hierarchicalChild = createHierarchical(
                             packageName, listSchemaNode, typeProviderWrapper,
-                            currentModule, identitiesToRpcs);
+                            currentModule, ctx);
                     runtimeBeanEntries.add(hierarchicalChild);
                 } else /* ordinary list attribute */{
                     ListAttribute listAttribute = ListAttribute.create(
@@ -260,18 +271,11 @@ public class RuntimeBeanEntry {
             if (ConfigConstants.RPC_CONTEXT_INSTANCE_EXTENSION_QNAME
                     .equals(unknownSchemaNode.getNodeType())) {
                 String localIdentityName = unknownSchemaNode.getNodeParameter();
-                QName identityQName = QName.create(currentModule.getNamespace(),
-                        currentModule.getRevision(), localIdentityName);
-                Set<RpcDefinition> rpcDefinitions = identitiesToRpcs
-                        .get(identityQName);
-                if (rpcDefinitions == null) {
-                    throw new IllegalArgumentException("Cannot find identity "
-                            + localIdentityName + " to be used as "
-                            + "context reference when resolving "
-                            + unknownSchemaNode);
-                }
+                QName identityQName = unknownSchemaNode.isAddedByUses() ?
+                        findQNameFromGrouping(subtree, ctx, unknownSchemaNode, localIdentityName) :
+                        QName.create(currentModule.getNamespace(), currentModule.getRevision(), localIdentityName);
                 // convert RpcDefinition to Rpc
-                for (RpcDefinition rpcDefinition : rpcDefinitions) {
+                for (RpcDefinition rpcDefinition : identitiesToRpcs.get(identityQName)) {
                     String name = TypeProviderWrapper
                             .findJavaParameter(rpcDefinition);
                     AttributeIfc returnType;
@@ -312,6 +316,22 @@ public class RuntimeBeanEntry {
                 attributes, rpcs);
     }
 
+    /**
+     * Find "proper" qname of unknown node in case it comes from a grouping
+     */
+    private static QName findQNameFromGrouping(final DataNodeContainer subtree, final SchemaContext ctx, final UnknownSchemaNode unknownSchemaNode, final String localIdentityName) {
+        QName identityQName = null;
+        for (UsesNode usesNode : subtree.getUses()) {
+            SchemaNode dataChildByName = SchemaContextUtil.findDataSchemaNode(ctx, usesNode.getGroupingPath());
+            Module m = SchemaContextUtil.findParentModule(ctx, dataChildByName);
+            List<UnknownSchemaNode> unknownSchemaNodes = dataChildByName.getUnknownSchemaNodes();
+            if(Collections2.transform(unknownSchemaNodes, UNKNOWN_NODE_TO_STRING).contains(UNKNOWN_NODE_TO_STRING.apply(unknownSchemaNode))) {
+                identityQName = QName.create(dataChildByName.getQName(), localIdentityName);
+            }
+        }
+        return identityQName;
+    }
+
     private static AttributeIfc getReturnTypeAttribute(final DataSchemaNode child, final TypeProviderWrapper typeProviderWrapper,
             final String packageName) {
         if (child instanceof LeafSchemaNode) {
@@ -355,13 +375,13 @@ public class RuntimeBeanEntry {
     private static RuntimeBeanEntry createHierarchical(final String packageName,
             final ListSchemaNode listSchemaNode,
             final TypeProviderWrapper typeProviderWrapper, final Module currentModule,
-            final Map<QName, Set<RpcDefinition>> identitiesToRpcs) {
+            final SchemaContext ctx) {
 
         // supported are numeric types, strings, enums
         // get all attributes
         AttributesRpcsAndRuntimeBeans attributesRpcsAndRuntimeBeans = extractSubtree(
                 packageName, listSchemaNode, typeProviderWrapper,
-                currentModule, identitiesToRpcs);
+                currentModule, ctx);
 
         Optional<String> keyYangName;
         if (listSchemaNode.getKeyDefinition().isEmpty()) {
index ee02b30..f03bd96 100644 (file)
@@ -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
  * </p>
  */
 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,7 +122,7 @@ public class ServiceInterfaceEntry extends AbstractEntry {
      */
     public static Map<QName, ServiceInterfaceEntry> create(Module currentModule,
             String packageName,Map<IdentitySchemaNode, ServiceInterfaceEntry> definedSEItracker) {
-        LOGGER.debug("Generating ServiceInterfaces from {} to package {}",
+        LOG.debug("Generating ServiceInterfaces from {} to package {}",
                 currentModule.getNamespace(), packageName);
 
         Map<IdentitySchemaNode, ServiceInterfaceEntry> identitiesToSIs = new HashMap<>();
@@ -130,7 +131,7 @@ public class ServiceInterfaceEntry extends AbstractEntry {
         int lastSize = notVisited.size() + 1;
         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;
     }
index d9a6dd0..e6b69fb 100644 (file)
@@ -12,7 +12,7 @@ import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
 
 public abstract class AbstractAttribute implements AttributeIfc {
     private final String attributeYangName, upperCaseCammelCase,
-            lowerCaseCammelCase;
+    lowerCaseCammelCase;
     protected final DataSchemaNode node;
 
     private static String getLocalName(DataSchemaNode attrNode) {
index 6ea2ea1..fd07e26 100644 (file)
@@ -28,17 +28,21 @@ public class Dependency {
 
     @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;
+        }
 
         Dependency that = (Dependency) o;
 
-        if (mandatory != that.mandatory)
+        if (mandatory != that.mandatory) {
             return false;
-        if (!sie.equals(that.sie))
+        }
+        if (!sie.equals(that.sie)) {
             return false;
+        }
 
         return true;
     }
index d8df78a..a82571c 100644 (file)
@@ -7,14 +7,13 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.attribute;
 
+import javax.management.ObjectName;
+import javax.management.openmbean.SimpleType;
 import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
 import org.opendaylight.yangtools.binding.generator.util.Types;
 import org.opendaylight.yangtools.sal.binding.model.api.Type;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
 
-import javax.management.ObjectName;
-import javax.management.openmbean.SimpleType;
-
 public class DependencyAttribute extends AbstractDependencyAttribute {
 
 
index 8d31399..f6ce92d 100644 (file)
@@ -8,6 +8,13 @@
 package org.opendaylight.controller.config.yangjmxgenerator.attribute;
 
 import com.google.common.base.Preconditions;
+import java.util.Arrays;
+import java.util.List;
+import javax.management.openmbean.ArrayType;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.OpenType;
+import javax.management.openmbean.SimpleType;
 import org.opendaylight.controller.config.api.IdentityAttributeRef;
 import org.opendaylight.controller.config.yangjmxgenerator.TypeProviderWrapper;
 import org.opendaylight.yangtools.sal.binding.model.api.Type;
@@ -17,14 +24,6 @@ import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition;
 
-import javax.management.openmbean.ArrayType;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.OpenType;
-import javax.management.openmbean.SimpleType;
-import java.util.Arrays;
-import java.util.List;
-
 public class JavaAttribute extends AbstractAttribute implements TypedAttribute {
 
     public static final String DESCRIPTION_OF_VALUE_ATTRIBUTE_FOR_UNION = "valueOfArtificialUnionProperty";
@@ -233,7 +232,7 @@ public class JavaAttribute extends AbstractAttribute implements TypedAttribute {
         return simpleType;
     }
 
-     private OpenType<?> getCompositeType(Type baseType, TypeDefinition<?> baseTypeDefinition) {
+    private OpenType<?> getCompositeType(Type baseType, TypeDefinition<?> baseTypeDefinition) {
 
         SimpleType<?> innerItemType = SimpleTypeResolver.getSimpleType(baseType);
         String innerItemName = typeProviderWrapper.getJMXParamForBaseType(baseTypeDefinition);
@@ -282,8 +281,9 @@ public class JavaAttribute extends AbstractAttribute implements TypedAttribute {
 
     // TODO verify
     private boolean isPrimitive(String innerTypeFullyQName) {
-        if (innerTypeFullyQName.contains("."))
+        if (innerTypeFullyQName.contains(".")) {
             return false;
+        }
 
         return true;
     }
index bb71f9d..9d89963 100644 (file)
@@ -7,6 +7,10 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.attribute;
 
+import java.util.List;
+import javax.management.openmbean.ArrayType;
+import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.OpenType;
 import org.opendaylight.controller.config.yangjmxgenerator.TypeProviderWrapper;
 import org.opendaylight.yangtools.binding.generator.util.Types;
 import org.opendaylight.yangtools.sal.binding.model.api.Type;
@@ -14,11 +18,6 @@ import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
 
-import javax.management.openmbean.ArrayType;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.OpenType;
-import java.util.List;
-
 public class ListAttribute extends AbstractAttribute implements TypedAttribute {
 
     private final String nullableDescription, nullableDefault;
index 641099a..48d06a3 100644 (file)
@@ -7,16 +7,15 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.attribute;
 
-import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
-import org.opendaylight.yangtools.binding.generator.util.Types;
-import org.opendaylight.yangtools.sal.binding.model.api.Type;
-import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-
+import java.util.List;
 import javax.management.ObjectName;
 import javax.management.openmbean.ArrayType;
 import javax.management.openmbean.OpenType;
 import javax.management.openmbean.SimpleType;
-import java.util.List;
+import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
+import org.opendaylight.yangtools.binding.generator.util.Types;
+import org.opendaylight.yangtools.sal.binding.model.api.Type;
+import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
 
 public class ListDependenciesAttribute extends AbstractDependencyAttribute {
 
index 9b55301..8454a6b 100644 (file)
@@ -9,13 +9,12 @@ package org.opendaylight.controller.config.yangjmxgenerator.attribute;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
-import org.opendaylight.yangtools.sal.binding.model.api.Type;
-
-import javax.management.openmbean.SimpleType;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.Date;
 import java.util.Map;
+import javax.management.openmbean.SimpleType;
+import org.opendaylight.yangtools.sal.binding.model.api.Type;
 
 public class SimpleTypeResolver {
 
index e563da1..91016d4 100644 (file)
@@ -11,6 +11,15 @@ import com.google.common.base.Function;
 import com.google.common.collect.Collections2;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.OpenType;
 import org.opendaylight.controller.config.yangjmxgenerator.TypeProviderWrapper;
 import org.opendaylight.yangtools.binding.generator.util.ReferencedTypeImpl;
 import org.opendaylight.yangtools.sal.binding.model.api.Type;
@@ -22,16 +31,6 @@ import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
 
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.OpenType;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
 public class TOAttribute extends AbstractAttribute implements TypedAttribute {
 
     private final String nullableDescription, nullableDefault;
index 966aff9..7c3ebb5 100644 (file)
@@ -14,8 +14,9 @@ public class FullyQualifiedNameHelper {
 
     public static String getFullyQualifiedName(String packageName,
             String className) {
-        if (packageName.isEmpty())
+        if (packageName.isEmpty()) {
             return className;
+        }
         return packageName + "." + className;
     }
 }
index e3c3a30..a937af9 100644 (file)
@@ -7,8 +7,8 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator;
 
-import static org.junit.Assert.assertNotNull;
 import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertThat;
 
 import com.google.common.base.Preconditions;
@@ -34,8 +34,8 @@ public abstract class AbstractYangTest {
     protected Map<String, Module> namesToModules; // are module names globally
                                                   // unique?
     protected Module configModule, rpcContextModule, threadsModule,
-            threadsJavaModule, bgpListenerJavaModule, ietfInetTypesModule,
-            jmxModule, jmxImplModule, testFilesModule, testFiles1Module;
+    threadsJavaModule, bgpListenerJavaModule, ietfInetTypesModule,
+    jmxModule, jmxImplModule, testFilesModule, testFiles1Module;
 
     public static final String EVENTBUS_MXB_NAME = "eventbus";
     public static final String ASYNC_EVENTBUS_MXB_NAME = "async-eventbus";
@@ -116,7 +116,7 @@ public abstract class AbstractYangTest {
     protected Map<String /* identity local name */, ModuleMXBeanEntry> loadThreadsJava(Map<QName, ServiceInterfaceEntry> modulesToSIEs, String packageName) {
         Map<String /* identity local name */, ModuleMXBeanEntry> namesToMBEs = ModuleMXBeanEntry
                 .create(threadsJavaModule, modulesToSIEs, context, new TypeProviderWrapper(new TypeProviderImpl
-                        (context)), packageName);
+                (context)), packageName);
         Assert.assertNotNull(namesToMBEs);
         Set<String> expectedMXBeanNames = Sets.newHashSet(EVENTBUS_MXB_NAME,
                 ASYNC_EVENTBUS_MXB_NAME, THREADFACTORY_NAMING_MXB_NAME,
index cac0ac7..65f0f54 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.config.yangjmxgenerator;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
+import com.google.common.base.Preconditions;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
@@ -18,7 +19,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
 import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.NameConflictException;
@@ -30,11 +30,9 @@ import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 public class ModuleMXBeanEntryNameConflictTest extends AbstractYangTest {
 
-    private static final Logger logger = LoggerFactory
+    private static final Logger LOG = LoggerFactory
             .getLogger(ModuleMXBeanEntryNameConflictTest.class);
 
     public static final String PACKAGE_NAME = "pack2";
@@ -54,7 +52,7 @@ public class ModuleMXBeanEntryNameConflictTest extends AbstractYangTest {
             Module testedModule = loadYangs(yangFile, moduleName);
 
             try {
-                logger.debug("Testing {}", yangFile);
+                LOG.debug("Testing {}", yangFile);
                 ModuleMXBeanEntry.create(testedModule,
                         new HashMap<QName, ServiceInterfaceEntry>(), context,
                         new TypeProviderWrapper(new TypeProviderImpl(context)),
index fab273c..17d4d9a 100644 (file)
@@ -18,7 +18,6 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 
 import com.google.common.collect.Sets;
-
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.text.ParseException;
@@ -31,11 +30,9 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.regex.Matcher;
-
 import javax.management.openmbean.ArrayType;
 import javax.management.openmbean.CompositeType;
 import javax.management.openmbean.SimpleType;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc;
index 031acfa..10c42a8 100644 (file)
@@ -11,14 +11,12 @@ import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 
+import com.google.common.collect.Maps;
 import java.net.URI;
 import java.util.Map;
-
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.model.api.Module;
 
-import com.google.common.collect.Maps;
-
 public class PackageTranslatorTest {
     public static final String EXPECTED_PACKAGE_PREFIX = "org.opendaylight.controller.config";
 
index 38b0a3a..98b1f75 100644 (file)
@@ -20,9 +20,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-
 import javax.management.openmbean.SimpleType;
-
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.opendaylight.controller.config.yangjmxgenerator.attribute.JavaAttribute;
@@ -54,7 +52,7 @@ public class RuntimeBeanEntryTest extends AbstractYangTest {
                 .getUnknownSchemaNodes();
         Map<String, RuntimeBeanEntry> runtimeBeans = RuntimeBeanEntry
                 .extractClassNameToRuntimeBeanMap(PACKAGE_NAME, caseNode, "test-name", new TypeProviderWrapper(new
-                        TypeProviderImpl(context)), "test", jmxImplModule);
+                        TypeProviderImpl(context)), "test", jmxImplModule, context);
         assertEquals(1, runtimeBeans.size());
         RuntimeBeanEntry runtimeMXBean = runtimeBeans.get("testRuntimeMXBean");
         assertTrue(runtimeMXBean.isRoot());
index b72d85c..b189db4 100644 (file)
@@ -15,20 +15,18 @@ import static org.junit.Assert.assertTrue;
 import static org.opendaylight.controller.config.yangjmxgenerator.ConfigConstants.MODULE_TYPE_Q_NAME;
 import static org.opendaylight.controller.config.yangjmxgenerator.ConfigConstants.SERVICE_TYPE_Q_NAME;
 
+import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableMap;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 
-import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableMap;
-
 public class SchemaContextTest extends AbstractYangTest {
 
     IdentitySchemaNode findIdentityByQName(Module module, QName qName) {
@@ -103,14 +101,15 @@ public class SchemaContextTest extends AbstractYangTest {
         Map<String /* identity name */, Optional<QName>> expectedIdentitiesToBases = new HashMap<String, Optional<QName>>(){
             private static final long serialVersionUID = 1L;
 
-        {
-            put(ModuleMXBeanEntryTest.EVENTBUS_MXB_NAME, Optional.of(MODULE_TYPE_Q_NAME));
-            put(ModuleMXBeanEntryTest.ASYNC_EVENTBUS_MXB_NAME, Optional.of(MODULE_TYPE_Q_NAME));
-            put(ModuleMXBeanEntryTest.THREADFACTORY_NAMING_MXB_NAME, Optional.of(MODULE_TYPE_Q_NAME));
-            put(ModuleMXBeanEntryTest.THREADPOOL_DYNAMIC_MXB_NAME, Optional.of(MODULE_TYPE_Q_NAME));
-            put("thread-rpc-context", Optional.<QName>absent());
-            put(ModuleMXBeanEntryTest.THREADPOOL_REGISTRY_IMPL_NAME, Optional.of(MODULE_TYPE_Q_NAME));
-        }};
+            {
+                put(ModuleMXBeanEntryTest.EVENTBUS_MXB_NAME, Optional.of(MODULE_TYPE_Q_NAME));
+                put(ModuleMXBeanEntryTest.ASYNC_EVENTBUS_MXB_NAME, Optional.of(MODULE_TYPE_Q_NAME));
+                put(ModuleMXBeanEntryTest.THREADFACTORY_NAMING_MXB_NAME, Optional.of(MODULE_TYPE_Q_NAME));
+                put(ModuleMXBeanEntryTest.THREADPOOL_DYNAMIC_MXB_NAME, Optional.of(MODULE_TYPE_Q_NAME));
+                put("thread-rpc-context", Optional.<QName>absent());
+                put(ModuleMXBeanEntryTest.THREADPOOL_REGISTRY_IMPL_NAME, Optional.of(MODULE_TYPE_Q_NAME));
+            }
+        };
 
         assertAllIdentitiesAreExpected(threadsJavaModule,
                 expectedIdentitiesToBases);
index f22edbf..f021c2c 100644 (file)
@@ -12,7 +12,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertThat;
 
 import com.google.common.collect.Sets;
-
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.text.ParseException;
@@ -25,7 +24,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
-
 import org.hamcrest.CoreMatchers;
 import org.junit.Test;
 import org.opendaylight.yangtools.yang.common.QName;
index 11c7d04..ce70c9a 100644 (file)
@@ -7,14 +7,12 @@
  */
 package org.opendaylight.controller.config.yangjmxgenerator.plugin.util;
 
+import com.google.common.base.Preconditions;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
-
 import org.opendaylight.yangtools.yang.model.api.Module;
 
-import com.google.common.base.Preconditions;
-
 public class YangModelSearchUtils {
 
     public static Map<String, Module> mapModulesByNames(
index 91e92f7..0bd2db8 100644 (file)
@@ -10,10 +10,10 @@ package org.opendaylight.controller.config.yangjmxgenerator.unknownextension;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import com.google.common.collect.Lists;
 import java.io.InputStream;
 import java.util.List;
 import java.util.Set;
-
 import org.junit.Test;
 import org.opendaylight.controller.config.yangjmxgenerator.ConfigConstants;
 import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntryTest;
@@ -21,8 +21,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.YangModel
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.parser.impl.YangParserImpl;
 
-import com.google.common.collect.Lists;
-
 public class UnknownExtensionTest extends ServiceInterfaceEntryTest {
 
     @Test
index 4610662..29b37af 100644 (file)
@@ -7,12 +7,11 @@
  */
 package org.opendaylight.controller.config.yang.test.plugin;
 
+import java.io.File;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 
-import java.io.File;
-
 /**
  * Delete all Module/ModuleFactory sources
  *
@@ -35,12 +34,12 @@ public class DeleteSources extends AbstractMojo{
         }
         File sourceDirectory = new File(directory.getPath() + Util.replaceDots(".org.opendaylight.controller.config.yang.test.impl"));
         if (sourceDirectory == null || !sourceDirectory.exists()) {
-            super.getLog().error("Source directory does not exists " + sourceDirectory.getPath());
+            super.getLog().error(String.format("Source directory does not exists %s", sourceDirectory.getPath()));
         }
         File[] sourceFiles = sourceDirectory.listFiles();
         for (File sourceFile: sourceFiles) {
             if(sourceFile.getName().endsWith("Module.java") || sourceFile.getName().endsWith("ModuleFactory.java")) {
-                super.getLog().debug("Source file deleted: " + sourceFile.getName());
+                super.getLog().debug(String.format("Source file deleted: %s", sourceFile.getName()));
                 sourceFile.delete();
             }
         }
index 7a20f22..4e39230 100644 (file)
@@ -7,15 +7,14 @@
  */
 package org.opendaylight.controller.config.yang.test.plugin;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.regex.Pattern;
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.regex.Pattern;
-
 /**
  * Add implementation code from stub.txt
  *
@@ -39,7 +38,7 @@ public class ProcessSources extends AbstractMojo{
         }
         File sourceDirectory = new File(directory.getPath() + Util.replaceDots(".org.opendaylight.controller.config.yang.test.impl"));
         if (!sourceDirectory.exists()) {
-            super.getLog().error("Source directory does not exists " + sourceDirectory.getPath());
+            super.getLog().error(String.format("Source directory does not exists %s", sourceDirectory.getPath()));
         }
 
         File[] sourceFiles = sourceDirectory.listFiles();
@@ -49,7 +48,7 @@ public class ProcessSources extends AbstractMojo{
                 try {
                     sourceContent = FileUtils.readFileToString(sourceFile);
                 } catch (IOException e) {
-                    getLog().error("Cannot read " + sourceFile.getAbsolutePath(), e);
+                    getLog().error(String.format("Cannot read %s", sourceFile.getAbsolutePath()), e);
                     continue;
                 }
                 if (sourceFile.getName().endsWith("Module.java") || sourceFile.getName().endsWith("ModuleFactory.java")) {
@@ -59,7 +58,7 @@ public class ProcessSources extends AbstractMojo{
                         try {
                             stubContent = FileUtils.readFileToString(stubFile);
                         } catch (IOException e) {
-                            getLog().error("Cannot read " + stubFile.getAbsolutePath(), e);
+                            getLog().error(String.format("Cannot read %s", stubFile.getAbsolutePath()), e);
                         }
                         if (stubContent != null) {
                             sourceContent = rewriteStub(sourceContent, stubContent);
@@ -73,7 +72,7 @@ public class ProcessSources extends AbstractMojo{
                 try {
                     FileUtils.write(sourceFile, sourceContent);
                 } catch (IOException e) {
-                    getLog().error("Cannot write " + sourceFile.getAbsolutePath(), e);
+                    getLog().error(String.format("Cannot write %s", sourceFile.getAbsolutePath()), e);
                 }
             }
 
index 5e37f5a..2428b10 100644 (file)
@@ -11,6 +11,7 @@
 package org.opendaylight.controller.config.yang.test.util;
 
 import com.google.common.collect.Lists;
+import java.math.BigInteger;
 import java.util.List;
 import org.opendaylight.controller.config.yang.test.impl.Asdf;
 import org.opendaylight.controller.config.yang.test.impl.Deep2;
@@ -43,11 +44,36 @@ public class NetconfTestImplModuleUtil {
                 return asdf;
             }
 
+            @Override
+            public BigInteger getCommonStat() {
+                return new BigInteger("54");
+            }
+
             @Override
             public String noArg(final String arg1) {
                 return arg1.toUpperCase();
             }
 
+            @Override
+            public Long commonRpcTwo() {
+                return 1L;
+            }
+
+            @Override
+            public String commonRpcThree() {
+                return "true";
+            }
+
+            @Override
+            public Boolean commonRpc() {
+                return true;
+            }
+
+            @Override
+            public void netconfImplRpcFromGrouping() {
+                // rpc from grouping within same yang module</