Organize Imports for Checkstyle compliance.
Checkstyle compliance: line length.
Checkstyle compliance: various types of small changes.
Checkstyle compliant Exception handling.
Checkstyle final clean up & enforcement.
Add the fail on violation flag into the pom.xml .
Change-Id: I841ed5ba3ba57f91e18a82015c7582195cec5562
Signed-off-by: matus.kubica <matus.kubica@pantheon.tech>
public class YanglibModule extends org.opendaylight.controller.config.yang.yanglib.impl.AbstractYanglibModule {
private static final Logger LOG = LoggerFactory.getLogger(YanglibModule.class);
- public YanglibModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ public YanglibModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
- public YanglibModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.yanglib.impl.YanglibModule oldModule, java.lang.AutoCloseable oldInstance) {
+ public YanglibModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
+ org.opendaylight.controller.config.yang.yanglib.impl.YanglibModule oldModule,
+ java.lang.AutoCloseable oldInstance) {
super(identifier, dependencyResolver, oldModule, oldInstance);
}
* Do not modify this file unless it is present under src/main directory
*/
package org.opendaylight.controller.config.yang.yanglib.impl;
-public class YanglibModuleFactory extends org.opendaylight.controller.config.yang.yanglib.impl.AbstractYanglibModuleFactory {
+public class YanglibModuleFactory
+ extends org.opendaylight.controller.config.yang.yanglib.impl.AbstractYanglibModuleFactory {
}
/**
* Get {@link YangLibServiceImpl} via service.
- * @return
+ * @return YangLibServiceImpl
*/
YangLibServiceImpl getYangLibService();
}
public interface YangLibService {
/**
- * Get module's source for each module from yang library
+ * Get module's source for each module from yang library.
* @param name Module's name
* @param revision Module's revision
* @return Module's source
* along with source identifier to
* ietf-netconf-yang-library/modules-state/module list.
*/
-public class YangLibProvider implements BindingAwareProvider, AutoCloseable, SchemaSourceListener{
+public class YangLibProvider implements BindingAwareProvider, AutoCloseable, SchemaSourceListener {
private static final Logger LOG = LoggerFactory.getLogger(YangLibProvider.class);
private static final OptionalRevision NO_REVISION = new OptionalRevision("");
private static final Predicate<PotentialSchemaSource<?>> YANG_SCHEMA_SOURCE =
- input -> YangTextSchemaSource.class.isAssignableFrom(input.getRepresentation());
+ input -> YangTextSchemaSource.class.isAssignableFrom(input.getRepresentation());
protected DataBroker dataBroker;
protected SchemaListenerRegistration schemaListenerRegistration;
public void schemaSourceRegistered(final Iterable<PotentialSchemaSource<?>> sources) {
final List<Module> newModules = new ArrayList<>();
- for(PotentialSchemaSource<?> potentialYangSource : Iterables.filter(sources, YANG_SCHEMA_SOURCE)) {
+ for (PotentialSchemaSource<?> potentialYangSource : Iterables.filter(sources, YANG_SCHEMA_SOURCE)) {
final YangIdentifier moduleName = new YangIdentifier(potentialYangSource.getSourceIdentifier().getName());
final OptionalRevision moduleRevision = getRevisionForModule(potentialYangSource.getSourceIdentifier());
newModules.add(newModule);
}
- if(newModules.isEmpty()) {
+ if (newModules.isEmpty()) {
// If no new yang modules then do nothing
return;
}
}
@Override
- public void onFailure(final Throwable t) {
- LOG.warn("Unable to update modules state", t);
+ public void onFailure(final Throwable throwable) {
+ LOG.warn("Unable to update modules state", throwable);
}
});
}
@Override
public void schemaSourceUnregistered(final PotentialSchemaSource<?> source) {
- if(!YANG_SCHEMA_SOURCE.apply(source)) {
+ if (!YANG_SCHEMA_SOURCE.apply(source)) {
// if representation of potential schema source is not yang text schema source do nothing
// we do not want to delete this module entry from module list
return;
}
@Override
- public void onFailure(final Throwable t) {
- LOG.warn("Unable to update modules state", t);
+ public void onFailure(final Throwable throwable) {
+ LOG.warn("Unable to update modules state", throwable);
}
});
}
import org.slf4j.LoggerFactory;
/**
- * Provides schema sources from yang library
+ * Provides schema sources from yang library.
*/
public class YangLibServiceImpl implements YangLibService {
private static final Logger LOG = LoggerFactory.getLogger(YangLibServiceImpl.class);
try {
final YangTextSchemaSource source = sourceFuture.checkedGet();
return new String(ByteStreams.toByteArray(source.openStream()));
- } catch (SchemaSourceException|IOException e) {
+ } catch (SchemaSourceException | IOException e) {
throw new IllegalStateException("Unable to get schema" + sourceId, e);
}
}
private static class TestingYangLibProvider extends YangLibProvider {
- public TestingYangLibProvider(SharedSchemaRepository schemaRepository, String bindingAddress, long bindingPort) {
+ TestingYangLibProvider(
+ SharedSchemaRepository schemaRepository, String bindingAddress, long bindingPort) {
super(schemaRepository, bindingAddress, bindingPort);
}
assertTrue(singleton.contains(yangLibRestApp.getYangLibService()));
- then(bundleContext).should(times(1)).registerService(eq(YangLibRestAppService.class.getName()), eq(yangLibRestApp), eq(null));
+ then(bundleContext).should(times(1))
+ .registerService(eq(YangLibRestAppService.class.getName()), eq(yangLibRestApp), eq(null));
}
}
public class YangLibServiceImplTest {
- private final static String TEST_OUTPUT_STRING = "hello world";
+ private static final String TEST_OUTPUT_STRING = "hello world";
@Test
public void testSchema() throws SchemaSourceException {