Mechanical code cleanup (config) 66/46066/3
authorStephen Kitt <skitt@redhat.com>
Thu, 22 Sep 2016 15:12:00 +0000 (17:12 +0200)
committerTom Pantelis <tpanteli@brocade.com>
Fri, 23 Sep 2016 18:36:44 +0000 (18:36 +0000)
* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
  - enum constructors are private by default
  - interface properties are public static final by default
  - interface methods are public abstract by default
  - interfaces are abstract by default
  - inner interfaces are static by default
  - inner classes in interfaces are public static by default

Change-Id: Iefd8363a5eb120fdd43a4632b9e3db0e7e347dba
Signed-off-by: Stephen Kitt <skitt@redhat.com>
55 files changed:
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/ConfigRegistry.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/RuntimeBeanRegistratorAwareModule.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/annotations/AbstractServiceInterface.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/notifications/ConfigJMXNotification.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/osgi/WaitingServiceTracker.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/spi/Module.java
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/spi/ModuleFactory.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/fromxml/AttributeReadingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/mapping/SimpleAttributeMappingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/ArrayAttributeResolvingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/attributes/resolving/SimpleAttributeResolvingStrategy.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/mapping/config/Config.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/osgi/YangStoreActivator.java
opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/osgi/YangStoreService.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverImpl.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsHelper.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AttributeHolder.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/ReadOnlyAtomicBoolean.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/jmx/ServiceReferenceRegistrator.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BlankTransactionServiceTracker.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ExtensibleBundleTracker.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/AbstractConfigTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/AbstractLockedPlatformMBeanServerTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/ClassBasedModuleFactory.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/dynamicmbean/AnnotationsTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPConfigMXBean.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModuleFactory.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/test/MockedDependenciesTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolConfigBeanMXBean.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/scheduledthreadpool/TestingScheduledThreadPoolModuleFactory.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/seviceinterface/TestingThreadPoolServiceInterface.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolConfigMXBean.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingFixedThreadPoolModuleFactory.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/threadpool/TestingThreadPoolConfigMXBean.java
opendaylight/config/config-persister-api/src/main/java/org/opendaylight/controller/config/persist/api/ConfigPusher.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/ConfigPusherFeatureActivator.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ChildAwareFeatureWrapper.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ConfigFeaturesListener.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ConfigPusherCustomizer.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/ConfigPushingRunnable.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/FeatureConfigPusher.java
opendaylight/config/config-persister-feature-adapter/src/main/java/org/opendaylight/controller/configpusherfeature/internal/FeatureConfigSnapshotHolder.java
opendaylight/config/config-persister-impl/src/main/java/org/opendaylight/controller/config/persist/impl/ConfigPusherImpl.java
opendaylight/config/config-util/src/main/java/org/opendaylight/controller/config/util/capability/Capability.java
opendaylight/config/config-util/src/test/java/org/opendaylight/controller/config/util/TestingConfigTransactionController.java
opendaylight/config/logback-config/src/main/java/org/opendaylight/controller/config/yang/logback/config/ContextSetter.java
opendaylight/config/netty-event-executor-config/src/main/java/org/opendaylight/controller/config/yang/netty/eventexecutor/AutoCloseableEventExecutor.java
opendaylight/config/netty-threadgroup-config/src/main/java/org/opendaylight/controller/config/yang/netty/threadgroup/NettyThreadgroupModule.java
opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModule.java
opendaylight/config/threadpool-config-api/src/main/java/org/opendaylight/controller/config/threadpool/ScheduledThreadPool.java
opendaylight/config/threadpool-config-api/src/main/java/org/opendaylight/controller/config/threadpool/ThreadPool.java
opendaylight/config/threadpool-config-impl/src/main/java/org/opendaylight/controller/config/threadpool/util/FlexibleThreadPoolWrapper.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/RuntimeBeanEntryTest.java

index 96fa1ae..275858c 100644 (file)
@@ -23,8 +23,8 @@ public interface ConfigRegistry extends LookupRegistry, ServiceReferenceReadable
      * Only well-known ObjectName in configuration system, under which
      * ConfigRegisry is registered.
      */
-    public static final ObjectName OBJECT_NAME = ConfigRegistryConstants.OBJECT_NAME;
-    public static final ObjectName OBJECT_NAME_NO_NOTIFICATIONS = ConfigRegistryConstants.OBJECT_NAME_NO_NOTIFICATIONS;
+    ObjectName OBJECT_NAME = ConfigRegistryConstants.OBJECT_NAME;
+    ObjectName OBJECT_NAME_NO_NOTIFICATIONS = ConfigRegistryConstants.OBJECT_NAME_NO_NOTIFICATIONS;
 
     /**
      * Opens new configuration transaction.
index 2e6e0f3..41673bc 100644 (file)
@@ -23,7 +23,7 @@ public interface RuntimeBeanRegistratorAwareModule extends Module {
      *
      * @param rootRuntimeBeanRegistrator
      */
-    public void setRuntimeBeanRegistrator(
+    void setRuntimeBeanRegistrator(
             RootRuntimeBeanRegistrator rootRuntimeBeanRegistrator);
 
 }
index 261c5f5..0b1d787 100644 (file)
@@ -13,5 +13,5 @@ package org.opendaylight.controller.config.api.annotations;
  * one SI can extend another one, in which case all annotations in hierarchy
  * will be observed.
  */
-public abstract interface AbstractServiceInterface {
+public interface AbstractServiceInterface {
 }
index 1549e6b..d6abc64 100644 (file)
@@ -66,7 +66,7 @@ public final class WaitingServiceTracker<T> implements AutoCloseable {
     public static <T> WaitingServiceTracker<T> create(@Nonnull Class<T> serviceInterface, @Nonnull BundleContext context) {
         ServiceTracker<T, ?> tracker = new ServiceTracker<>(context, serviceInterface, null);
         tracker.open();
-        return new WaitingServiceTracker<T>(serviceInterface, tracker);
+        return new WaitingServiceTracker<>(serviceInterface, tracker);
     }
 
     /**
@@ -83,7 +83,7 @@ public final class WaitingServiceTracker<T> implements AutoCloseable {
         try {
             ServiceTracker<T, ?> tracker = new ServiceTracker<>(context, context.createFilter(newFilter), null);
             tracker.open();
-            return new WaitingServiceTracker<T>(serviceInterface, tracker);
+            return new WaitingServiceTracker<>(serviceInterface, tracker);
         } catch(InvalidSyntaxException e) {
             throw new IllegalArgumentException(String.format("Invalid OSGi filter %s", newFilter), e);
         }
index 53f03a2..4766ad8 100644 (file)
@@ -64,7 +64,7 @@ public interface Module extends Identifiable<ModuleIdentifier>{
      * @param oldModule old instance of Module
      * @return true if the instance produced by oldModule can be reused with current instance as well.
      */
-    public boolean canReuse(Module oldModule);
+    boolean canReuse(Module oldModule);
 
 
 }
index e28608a..9926363 100644 (file)
@@ -32,7 +32,7 @@ public interface ModuleFactory {
      *
      * @return human-friendly implementation name
      */
-    public String getImplementationName();
+    String getImplementationName();
 
     /**
      * Create a new Module instance. The returned object is expected to use the
@@ -49,7 +49,7 @@ public interface ModuleFactory {
      * @return newly created module
      *
      */
-    public Module createModule(String instanceName,
+    Module createModule(String instanceName,
             DependencyResolver dependencyResolver, BundleContext bundleContext);
 
     /**
@@ -90,7 +90,7 @@ public interface ModuleFactory {
      *             leaves server in a running state but no configuration
      *             transaction can be created.
      */
-    public Module createModule(String instanceName, DependencyResolver dependencyResolver,
+    Module createModule(String instanceName, DependencyResolver dependencyResolver,
             DynamicMBeanWithInstance old, BundleContext bundleContext) throws Exception;
 
     boolean isModuleImplementingServiceInterface(
@@ -112,7 +112,7 @@ public interface ModuleFactory {
      *
      * @return set of default modules. Null is not allowed.
      */
-    public Set<? extends Module> getDefaultModules(DependencyResolverFactory dependencyResolverFactory,
+    Set<? extends Module> getDefaultModules(DependencyResolverFactory dependencyResolverFactory,
             BundleContext bundleContext);
 
 }
index 021e065..73b9dd9 100644 (file)
@@ -77,7 +77,8 @@ final class ArrayAttributeResolvingStrategy extends AbstractAttributeResolvingSt
         // Rebuild open type. Underlying composite types might have changed
         if (innerTypeResolvingStrategy.getOpenType() instanceof CompositeType) {
             try {
-                final ArrayType<?> openType = new ArrayType<Object>(getOpenType().getDimension(), innerTypeResolvingStrategy.getOpenType());
+                final ArrayType<?> openType =
+                        new ArrayType<>(getOpenType().getDimension(), innerTypeResolvingStrategy.getOpenType());
                 setOpenType(openType);
             } catch (OpenDataException e) {
                 throw new IllegalStateException("An error occurred during restoration of array type " + this
index 9bee7a1..30726db 100644 (file)
@@ -293,7 +293,7 @@ public class Config {
     }
 
     private interface ResolvingStrategy<T> {
-        public T resolveElement(ModuleConfig moduleMapping, XmlElement moduleElement, ServiceRegistryWrapper serviceTracker,
-                                String instanceName, String moduleNamespace, EditStrategyType defaultStrategy) throws DocumentedException;
+        T resolveElement(ModuleConfig moduleMapping, XmlElement moduleElement, ServiceRegistryWrapper serviceTracker,
+                String instanceName, String moduleNamespace, EditStrategyType defaultStrategy) throws DocumentedException;
     }
 }
index 32e064a..4c5674a 100644 (file)
@@ -81,7 +81,8 @@ public class YangStoreActivator implements BundleActivator {
                     yangStoreService.refresh(runtimeContext);
                 }
 
-                yangStoreServiceServiceRegistration = context.registerService(YangStoreService.class, yangStoreService, new Hashtable<String, Object>());
+                yangStoreServiceServiceRegistration = context.registerService(YangStoreService.class, yangStoreService,
+                        new Hashtable<>());
                 configRegistryLookup = new ConfigRegistryLookupThread(yangStoreService);
                 configRegistryLookup.start();
                 return yangStoreService;
@@ -186,7 +187,8 @@ public class YangStoreActivator implements BundleActivator {
 
             final ConfigSubsystemFacadeFactory configSubsystemFacade =
                     new ConfigSubsystemFacadeFactory(jmxClient, jmxClientNoNotifications, yangStoreService);
-            osgiRegistrayion = context.registerService(ConfigSubsystemFacadeFactory.class, configSubsystemFacade, new Hashtable<String, Object>());
+            osgiRegistrayion = context.registerService(ConfigSubsystemFacadeFactory.class, configSubsystemFacade,
+                    new Hashtable<>());
         }
     }
 }
index 969b129..f89d26b 100644 (file)
@@ -43,7 +43,7 @@ public class YangStoreService implements YangStoreContext {
      * of the listener set.
      */
     @GuardedBy("listeners")
-    private final Set<ModuleListener> listeners = new HashSet<ModuleListener>();
+    private final Set<ModuleListener> listeners = new HashSet<>();
 
     /**
      * This is the latest snapshot. Some of its state is always initialized, but the MXBean maps potentially cause
index 8948c56..10128a2 100644 (file)
@@ -257,7 +257,7 @@ final class DependencyResolverImpl implements DependencyResolver,
         transactionStatus.checkCommitStarted();
         if (maxDependencyDepth == null) {
             maxDependencyDepth = getMaxDepth(this, manager,
-                    new LinkedHashSet<ModuleIdentifier>());
+                    new LinkedHashSet<>());
         }
     }
 
index fba9844..7fa70ca 100644 (file)
@@ -78,7 +78,7 @@ public class AnnotationsHelper {
      */
     static <T extends Annotation> List<T> findClassAnnotationInSuperClassesAndIfcs(
             final Class<?> clazz, final Class<T> annotationType, final Set<Class<?>> interfaces) {
-        List<T> result = new ArrayList<T>();
+        List<T> result = new ArrayList<>();
         Class<?> declaringClass = clazz;
         do {
             T annotation = declaringClass.getAnnotation(annotationType);
index 35ba29e..8618456 100644 (file)
@@ -131,7 +131,7 @@ class AttributeHolder {
                 .findMethodAnnotationInSuperClassesAndIfcs(setter, RequireInterface.class, inspectedInterfaces);
         // make sure the list if not empty contains always annotation with same
         // value
-        Set<Class<?>> foundValues = new HashSet<Class<?>>();
+        Set<Class<?>> foundValues = new HashSet<>();
         for (RequireInterface ri : foundRequireInterfaces) {
             foundValues.add(ri.value());
         }
index deccde0..583e8b4 100644 (file)
@@ -12,7 +12,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 public interface ReadOnlyAtomicBoolean {
     boolean get();
 
-    public static class ReadOnlyAtomicBooleanImpl implements
+    class ReadOnlyAtomicBooleanImpl implements
             ReadOnlyAtomicBoolean {
         private final AtomicBoolean atomicBoolean;
 
index f1ceb7e..eafe760 100644 (file)
@@ -13,7 +13,7 @@ import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
 
 public interface ServiceReferenceRegistrator extends AutoCloseable {
 
-    public String getNullableTransactionName();
+    String getNullableTransactionName();
 
     ServiceReferenceJMXRegistration registerMBean(ServiceReferenceMXBeanImpl object,
                                                           ObjectName on) throws InstanceAlreadyExistsException;
@@ -21,7 +21,7 @@ public interface ServiceReferenceRegistrator extends AutoCloseable {
     @Override
     void close();
 
-    public static class ServiceReferenceJMXRegistration implements AutoCloseable {
+    class ServiceReferenceJMXRegistration implements AutoCloseable {
         private final InternalJMXRegistration registration;
 
         ServiceReferenceJMXRegistration(InternalJMXRegistration registration) {
@@ -34,11 +34,11 @@ public interface ServiceReferenceRegistrator extends AutoCloseable {
         }
     }
 
-    public static interface ServiceReferenceTransactionRegistratorFactory {
-        public ServiceReferenceRegistrator create();
+    interface ServiceReferenceTransactionRegistratorFactory {
+        ServiceReferenceRegistrator create();
     }
 
-    public static class ServiceReferenceRegistratorImpl implements ServiceReferenceRegistrator {
+    class ServiceReferenceRegistratorImpl implements ServiceReferenceRegistrator {
         private final InternalJMXRegistrator currentJMXRegistrator;
         private final String nullableTransactionName;
 
@@ -73,13 +73,13 @@ public interface ServiceReferenceRegistrator extends AutoCloseable {
         public void close() {
             currentJMXRegistrator.close();
         }
-        public static interface ServiceReferenceTransactionRegistratorFactory {
-            public ServiceReferenceRegistrator create();
+        public interface ServiceReferenceTransactionRegistratorFactory {
+            ServiceReferenceRegistrator create();
         }
     }
 
 
-    public static class ServiceReferenceTransactionRegistratorFactoryImpl implements ServiceReferenceTransactionRegistratorFactory {
+    class ServiceReferenceTransactionRegistratorFactoryImpl implements ServiceReferenceTransactionRegistratorFactory {
         private final NestableJMXRegistrator parentRegistrator;
         private final String nullableTransactionName;
 
index fa46cae..6c7f38b 100644 (file)
@@ -108,7 +108,7 @@ public class BlankTransactionServiceTracker implements ServiceTrackerCustomizer<
     }
 
     @VisibleForTesting
-    static interface BlankTransaction {
+    interface BlankTransaction {
         CommitStatus hit() throws ValidationException, ConflictingVersionException;
     }
 }
index 31bd5fa..a0d9122 100644 (file)
@@ -132,7 +132,7 @@ public final class ExtensibleBundleTracker<T> extends BundleTracker<Future<T>> {
         }
     }
 
-    private static interface BundleStrategy {
+    private interface BundleStrategy {
         void execute(BundleTrackerCustomizer<?> tracker);
     }
 
index 38ff0d9..d65133c 100644 (file)
@@ -203,7 +203,7 @@ public abstract class AbstractConfigTest extends AbstractLockedPlatformMBeanServ
         return mock(BindingRuntimeContext.class);
     }
 
-    public static interface BundleContextServiceRegistrationHandler {
+    public interface BundleContextServiceRegistrationHandler {
         void handleServiceRegistration(Class<?> clazz, Object serviceInstance, Dictionary<String, ?> props);
     }
 
index 3c237d3..170878a 100644 (file)
@@ -105,7 +105,7 @@ public class ClassBasedModuleFactory implements ModuleFactory {
 
     @Override
     public Set<Module> getDefaultModules(DependencyResolverFactory dependencyResolverFactory, BundleContext bundleContext) {
-        return new HashSet<Module>();
+        return new HashSet<>();
     }
 
     @Override
index 853f8c0..029b347 100644 (file)
@@ -96,7 +96,7 @@ public class AnnotationsTest {
 
     @ServiceInterfaceAnnotation(value = SIMPLE, osgiRegistrationType = Executor.class,
         namespace = "ns", revision = "rev", localName = SIMPLE)
-    static interface SimpleSI extends AbstractServiceInterface {
+    interface SimpleSI extends AbstractServiceInterface {
 
     }
 
@@ -155,14 +155,13 @@ public class AnnotationsTest {
                 emptySetOfInterfaces(), "class");
     }
 
-    static interface SubSI extends SimpleSI {
+    interface SubSI extends SimpleSI {
 
     }
 
     @ServiceInterfaceAnnotation(value = SUBCLASS2, osgiRegistrationType = ExecutorService.class,
         namespace = "ns", revision = "rev", localName = SUBCLASS2)
-
-    static interface SubSI2 extends SubSI {
+    interface SubSI2 extends SubSI {
 
     }
 
@@ -192,7 +191,7 @@ public class AnnotationsTest {
         }
     }
 
-    public static interface HasSomeMethod {
+    public interface HasSomeMethod {
         void setSomething(ObjectName objectName);
     }
 
@@ -245,7 +244,7 @@ public class AnnotationsTest {
     }
 
     @Description("class")
-    static interface HasSomeMethodWithAnnotations {
+    interface HasSomeMethodWithAnnotations {
 
         @RequireInterface(SubSI2.class)
         @Description("descr")
@@ -273,7 +272,7 @@ public class AnnotationsTest {
 
         assertDescriptionOnClass(
                 HasSomeMethodWithAnnotationsImpl.class,
-                new HashSet<Class<?>>(Arrays
+                new HashSet<>(Arrays
                         .asList(HasSomeMethodWithAnnotations.class)), "class");
     }
 
index d838e7b..68f6102 100644 (file)
@@ -14,7 +14,7 @@ import org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnota
     namespace = "namespace", revision = "rev", localName = TestingParallelAPSPConfigMXBean.NAME)
 public interface TestingParallelAPSPConfigMXBean {
 
-    static final String NAME = "apsp";
+    String NAME = "apsp";
 
     ObjectName getThreadPool();
 
index 95de90d..6d151c4 100644 (file)
@@ -39,9 +39,9 @@ public class MockedDependenciesTest extends AbstractParallelAPSPTest {
                 mockedThreadPoolConfigFactory));
     }
 
-    public static interface MockedTestingThreadPoolConfigMXBean extends
+    public interface MockedTestingThreadPoolConfigMXBean extends
             TestingThreadPoolConfigMXBean {
-        public void setThreadCount(int threadCount);
+        void setThreadCount(int threadCount);
     }
 
     public static class MockedThreadPoolModule implements Module,
index 6ccb241..e2610d9 100644 (file)
@@ -12,10 +12,10 @@ import org.opendaylight.controller.config.manager.testingservices.threadpool.Tes
 public interface TestingScheduledThreadPoolConfigBeanMXBean extends
         TestingThreadPoolConfigMXBean {
 
-    public boolean isRecreate();
+    boolean isRecreate();
 
-    public void setRecreate(boolean recreate);
+    void setRecreate(boolean recreate);
 
-    public void setThreadCount(int threadCount);
+    void setThreadCount(int threadCount);
 
 }
index 0a886e5..2d99b25 100644 (file)
@@ -15,5 +15,5 @@ import org.opendaylight.controller.config.manager.testingservices.threadpool.Tes
     namespace = "ns", revision = "foo", localName = "testing-threadpool")
 public interface TestingThreadPoolServiceInterface extends
         AbstractServiceInterface {
-    public static final String QNAME = "(ns?revision=foo)testing-threadpool";
+    String QNAME = "(ns?revision=foo)testing-threadpool";
 }
index 115eb83..34f24c6 100644 (file)
@@ -10,10 +10,10 @@ package org.opendaylight.controller.config.manager.testingservices.threadpool;
 public interface TestingFixedThreadPoolConfigMXBean extends
         TestingThreadPoolConfigMXBean {
 
-    public void setThreadCount(int threadCount);
+    void setThreadCount(int threadCount);
 
-    public boolean isTriggerNewInstanceCreation();
+    boolean isTriggerNewInstanceCreation();
 
-    public void setTriggerNewInstanceCreation(boolean boolTest);
+    void setTriggerNewInstanceCreation(boolean boolTest);
 
 }
index d385a7d..2fef47e 100644 (file)
@@ -69,7 +69,7 @@ public class TestingFixedThreadPoolModuleFactory extends AbstractTestingFixedThr
 
     @Override
     public Set<Module> getDefaultModules(final DependencyResolverFactory dependencyResolverFactory, final BundleContext bundleContext) {
-        return new HashSet<Module>();
+        return new HashSet<>();
     }
 
     @Override
index 2dade8a..106ab6b 100644 (file)
@@ -17,5 +17,5 @@ public interface ConfigPusher {
      * Pushes configs into the config subsystem
      */
 
-    public void pushConfigs(List<? extends ConfigSnapshotHolder> configs) throws InterruptedException;
+    void pushConfigs(List<? extends ConfigSnapshotHolder> configs) throws InterruptedException;
 }
index ea99579..0b4f6f7 100644 (file)
@@ -22,7 +22,7 @@ public class ConfigPusherFeatureActivator implements BundleActivator {
     public void start(BundleContext context) throws Exception {
         bc = context;
         cpc = new ConfigPusherCustomizer();
-        cpst = new ServiceTracker<ConfigPusher, ConfigPusher>(bc, ConfigPusher.class.getName(), cpc);
+        cpst = new ServiceTracker<>(bc, ConfigPusher.class.getName(), cpc);
         cpst.open();
     }
 
index 7da9b9f..672784a 100644 (file)
@@ -54,7 +54,7 @@ public class ChildAwareFeatureWrapper extends AbstractFeatureWrapper implements
      */
     public LinkedHashSet <? extends ChildAwareFeatureWrapper> getChildFeatures() throws Exception {
         List<Dependency> dependencies = feature.getDependencies();
-        LinkedHashSet <ChildAwareFeatureWrapper> childFeatures = new LinkedHashSet<ChildAwareFeatureWrapper>();
+        LinkedHashSet <ChildAwareFeatureWrapper> childFeatures = new LinkedHashSet<>();
         if(dependencies != null) {
             for(Dependency dependency: dependencies) {
                 Feature fi = extractFeatureFromDependency(dependency);
@@ -73,7 +73,7 @@ public class ChildAwareFeatureWrapper extends AbstractFeatureWrapper implements
 
     @Override
     public LinkedHashSet<FeatureConfigSnapshotHolder> getFeatureConfigSnapshotHolders() throws Exception {
-        LinkedHashSet <FeatureConfigSnapshotHolder> snapShotHolders = new LinkedHashSet<FeatureConfigSnapshotHolder>();
+        LinkedHashSet <FeatureConfigSnapshotHolder> snapShotHolders = new LinkedHashSet<>();
         for(ChildAwareFeatureWrapper c: getChildFeatures()) {
             for(FeatureConfigSnapshotHolder h: c.getFeatureConfigSnapshotHolders()) {
                 final Optional<FeatureConfigSnapshotHolder> featureConfigSnapshotHolder = getFeatureConfigSnapshotHolder(h.getFileInfo());
index 72abca1..3297ba4 100644 (file)
@@ -20,7 +20,7 @@ import org.slf4j.LoggerFactory;
 public class ConfigFeaturesListener implements  FeaturesListener,  AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(ConfigFeaturesListener.class);
     private static final int QUEUE_SIZE = 1000;
-    private BlockingQueue<FeatureEvent> queue = new LinkedBlockingQueue<FeatureEvent>(QUEUE_SIZE);
+    private BlockingQueue<FeatureEvent> queue = new LinkedBlockingQueue<>(QUEUE_SIZE);
     Thread pushingThread = null;
 
     public ConfigFeaturesListener(ConfigPusher p, FeaturesService f) {
index 52bca76..420e8d7 100644 (file)
@@ -28,7 +28,7 @@ public class ConfigPusherCustomizer implements ServiceTrackerCustomizer<ConfigPu
         BundleContext bc = configPusherServiceReference.getBundle().getBundleContext();
         ConfigPusher cpService = bc.getService(configPusherServiceReference);
         featureServiceCustomizer = new FeatureServiceCustomizer(cpService);
-        fsst = new ServiceTracker<FeaturesService, FeaturesService>(bc, FeaturesService.class.getName(), featureServiceCustomizer);
+        fsst = new ServiceTracker<>(bc, FeaturesService.class.getName(), featureServiceCustomizer);
         fsst.open();
         return cpService;
     }
index a32a0ac..e94d615 100644 (file)
@@ -32,7 +32,7 @@ public class ConfigPushingRunnable implements Runnable {
 
     @Override
     public void run() {
-        List<Feature> toInstall = new ArrayList<Feature>();
+        List<Feature> toInstall = new ArrayList<>();
         FeatureEvent event = null;
         boolean interuppted = false;
         while(true) {
index 0d30545..f11da07 100644 (file)
@@ -36,7 +36,7 @@ public class FeatureConfigPusher {
      * chains.  Also, preserves the *original* Feature chain for which we pushed the config.
      * (which is handy for logging).
      */
-    LinkedHashSet<FeatureConfigSnapshotHolder> pushedConfigs = new LinkedHashSet<FeatureConfigSnapshotHolder>();
+    LinkedHashSet<FeatureConfigSnapshotHolder> pushedConfigs = new LinkedHashSet<>();
     /*
      * LinkedHashMultimap to track which configs we pushed for each Feature installation
      * For future use
@@ -118,7 +118,7 @@ public class FeatureConfigPusher {
     }
 
     private LinkedHashSet<FeatureConfigSnapshotHolder> pushConfig(final LinkedHashSet<FeatureConfigSnapshotHolder> configs, final Feature feature) throws InterruptedException {
-        LinkedHashSet<FeatureConfigSnapshotHolder> configsToPush = new LinkedHashSet<FeatureConfigSnapshotHolder>(configs);
+        LinkedHashSet<FeatureConfigSnapshotHolder> configsToPush = new LinkedHashSet<>(configs);
         configsToPush.removeAll(pushedConfigs);
         if (!configsToPush.isEmpty()) {
 
@@ -134,7 +134,7 @@ public class FeatureConfigPusher {
 
             pushedConfigs.addAll(configsToPush);
         }
-        LinkedHashSet<FeatureConfigSnapshotHolder> configsPushed = new LinkedHashSet<FeatureConfigSnapshotHolder>(pushedConfigs);
+        LinkedHashSet<FeatureConfigSnapshotHolder> configsPushed = new LinkedHashSet<>(pushedConfigs);
         configsPushed.retainAll(configs);
         return configsPushed;
     }
index 15c14da..1352117 100644 (file)
@@ -40,7 +40,7 @@ import org.opendaylight.controller.config.persist.storage.file.xml.model.ConfigS
 public class FeatureConfigSnapshotHolder implements ConfigSnapshotHolder {
     private ConfigSnapshot unmarshalled = null;
     private ConfigFileInfo fileInfo = null;
-    private List<Feature> featureChain = new ArrayList<Feature>();
+    private List<Feature> featureChain = new ArrayList<>();
 
     /*
      * @param holder - FeatureConfigSnapshotHolder that we
index 90f71ca..d93bd7d 100644 (file)
@@ -72,7 +72,6 @@ public class ConfigPusherImpl implements ConfigPusher {
     public void process(List<AutoCloseable> autoCloseables, MBeanServerConnection platformMBeanServer,
             Persister persisterAggregator, boolean propagateExceptions) throws InterruptedException {
         while(processSingle(autoCloseables, platformMBeanServer, persisterAggregator, propagateExceptions)) {
-            ;
         }
     }
 
index f9288ab..2813461 100644 (file)
@@ -18,15 +18,15 @@ import java.util.Collection;
 // TODO this should be placed into API bundle for netconf
 public interface Capability {
 
-    public String getCapabilityUri();
+    String getCapabilityUri();
 
-    public Optional<String> getModuleNamespace();
+    Optional<String> getModuleNamespace();
 
-    public Optional<String> getModuleName();
+    Optional<String> getModuleName();
 
-    public Optional<String> getRevision();
+    Optional<String> getRevision();
 
-    public Optional<String> getCapabilitySchema();
+    Optional<String> getCapabilitySchema();
 
-    public Collection<String> getLocation();
+    Collection<String> getLocation();
 }
index 73ab6da..d3b8add 100644 (file)
@@ -49,8 +49,8 @@ public class TestingConfigTransactionController implements
                 + ":type=Module," + ObjectNameUtil.MODULE_FACTORY_NAME_KEY
                 + "=" + moduleName2 + "," + ObjectNameUtil.INSTANCE_NAME_KEY
                 + "=" + instName2);
-        mapSub = new HashMap<String, ObjectName>();
-        map = new HashMap<String, Map<String,ObjectName>>();
+        mapSub = new HashMap<>();
+        map = new HashMap<>();
     }
 
     @Override
index 99d94d0..b77126b 100644 (file)
@@ -18,7 +18,7 @@ import java.util.concurrent.TimeUnit;
 public interface AutoCloseableEventExecutor extends EventExecutor, AutoCloseable {
 
 
-    public static class CloseableEventExecutorMixin implements AutoCloseable {
+    class CloseableEventExecutorMixin implements AutoCloseable {
         public static final int DEFAULT_SHUTDOWN_SECONDS = 1;
         private final EventExecutor eventExecutor;
 
index fa11652..2ae5715 100644 (file)
@@ -74,6 +74,6 @@ public final class NettyThreadgroupModule extends org.opendaylight.controller.co
         this.bundleContext = bundleContext;
     }
 
-    private static interface AutoCloseableEventLoopGroupInterface extends EventLoopGroup, AutoCloseable {
+    private interface AutoCloseableEventLoopGroupInterface extends EventLoopGroup, AutoCloseable {
     }
 }
index d1d5540..579806f 100644 (file)
@@ -81,6 +81,6 @@ public final class HashedWheelTimerModule extends
         this.bundleContext = bundleContext;
     }
 
-    private static interface AutoCloseableTimerInterface extends Timer, AutoCloseable {
+    private interface AutoCloseableTimerInterface extends Timer, AutoCloseable {
     }
 }
index 701b0bc..68ecb80 100644 (file)
@@ -15,7 +15,7 @@ import java.util.concurrent.ExecutorService;
  */
 public interface ThreadPool {
 
-    public ExecutorService getExecutor();
+    ExecutorService getExecutor();
 
-    public int getMaxThreadCount();
+    int getMaxThreadCount();
 }
\ No newline at end of file
index d013a0a..f416ed6 100644 (file)
@@ -54,7 +54,7 @@ public class FlexibleThreadPoolWrapper implements ThreadPool, Closeable {
      * This impl saturates threadpool first, then queue. When both are full caller will get blocked.
      */
     private static ForwardingBlockingQueue getQueue(Optional<Integer> capacity) {
-        final BlockingQueue<Runnable> delegate = capacity.isPresent() ? new LinkedBlockingQueue<Runnable>(capacity.get()) : new LinkedBlockingQueue<Runnable>();
+        final BlockingQueue<Runnable> delegate = capacity.isPresent() ? new LinkedBlockingQueue<>(capacity.get()) : new LinkedBlockingQueue<>();
         return new ForwardingBlockingQueue(delegate);
     }
 
index ed4437d..e7f1025 100644 (file)
@@ -54,7 +54,7 @@ public class ModuleMXBeanEntryNameConflictTest extends AbstractYangTest {
             try {
                 LOG.debug("Testing {}", yangFile);
                 ModuleMXBeanEntry.create(testedModule,
-                        new HashMap<QName, ServiceInterfaceEntry>(), context,
+                        new HashMap<>(), context,
                         new TypeProviderWrapper(new TypeProviderImpl(context)),
                         PACKAGE_NAME);
                 fail(yangFile.toString()
index 50f38e3..0681973 100644 (file)
@@ -273,18 +273,18 @@ public class ModuleMXBeanEntryTest extends AbstractYangTest {
                 assertThat(toAttr.getLowerCaseCammelCase(), is("peer"));
                 assertThat(toAttr.getUpperCaseCammelCase(), is("Peer"));
                 assertThat(toAttr.getOpenType(), isA(CompositeType.class));
-                Set<String> propsExpected = new HashSet<String>(2);
+                Set<String> propsExpected = new HashSet<>(2);
                 propsExpected.add("port");
                 propsExpected.add("core-size");
                 assertThat(toAttr.getYangPropertiesToTypesMap().keySet(),
                         is(propsExpected));
-                propsExpected = new HashSet<String>(2);
+                propsExpected = new HashSet<>(2);
                 propsExpected.add("Port");
                 propsExpected.add("CoreSize");
                 assertThat(
                         toAttr.getCapitalizedPropertiesToTypesMap().keySet(),
                         is(propsExpected));
-                propsExpected = new HashSet<String>(2);
+                propsExpected = new HashSet<>(2);
                 propsExpected.add("port");
                 propsExpected.add("coreSize");
                 assertThat(toAttr.getJmxPropertiesToTypesMap().keySet(),
index 98b1f75..dcb9089 100644 (file)
@@ -103,7 +103,7 @@ public class RuntimeBeanEntryTest extends AbstractYangTest {
         assertEquals(THREAD_RUNTIME_BEAN_YANG_NAME, runtimeBeanEntry.getYangName());
 
         // get thread runtime bean rpcs
-        List<RuntimeBeanEntry.Rpc> rpcs = new ArrayList<RuntimeBeanEntry.Rpc>(
+        List<RuntimeBeanEntry.Rpc> rpcs = new ArrayList<>(
                 runtimeBeanEntry.getRpcs());
         assertEquals(2, rpcs.size());
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.