Fix checkstyle issues to enforce it
[controller.git] / opendaylight / config / config-manager / src / test / java / org / opendaylight / controller / config / manager / testingservices / threadpool / TestingFixedThreadPool.java
index 25125fcd8287eb77928a258dd8c406a6c40d617b..35413a1b1fcc23541cf60b719d1386a5ece20324 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2013, 2017 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,
@@ -10,6 +10,7 @@ package org.opendaylight.controller.config.manager.testingservices.threadpool;
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
 
+import com.google.common.collect.Lists;
 import java.io.Closeable;
 import java.io.IOException;
 import java.util.Collections;
@@ -19,30 +20,28 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ThreadPoolExecutor;
 
-import com.google.common.collect.Lists;
-
 public class TestingFixedThreadPool implements TestingThreadPoolIfc, Closeable,
         TestingModifiableThreadPoolIfc {
     private final ThreadPoolExecutor executorService;
     private final String uniqueName;
 
     public static void cleanUp() {
-        for (ExecutorService executorService : allExecutors) {
+        for (ExecutorService executorService : ALL_EXECUTORS) {
             executorService.shutdown();
         }
-        allExecutors.clear();
+        ALL_EXECUTORS.clear();
     }
 
     // for verification purposes:
-    public static final List<ThreadPoolExecutor> allExecutors = Collections
+    public static final List<ThreadPoolExecutor> ALL_EXECUTORS = Collections
             .synchronizedList(Lists.<ThreadPoolExecutor>newLinkedList());
 
-    public TestingFixedThreadPool(int threadCount, String uniqueName) {
+    public TestingFixedThreadPool(final int threadCount, final String uniqueName) {
         checkNotNull(uniqueName);
         this.uniqueName = uniqueName;
         executorService = (ThreadPoolExecutor) Executors
                 .newFixedThreadPool(threadCount);
-        allExecutors.add(executorService);
+        ALL_EXECUTORS.add(executorService);
     }
 
     @Override
@@ -53,7 +52,7 @@ public class TestingFixedThreadPool implements TestingThreadPoolIfc, Closeable,
     @Override
     public void close() throws IOException {
         executorService.shutdown();
-        allExecutors.remove(executorService);
+        ALL_EXECUTORS.remove(executorService);
 
     }
 
@@ -67,9 +66,8 @@ public class TestingFixedThreadPool implements TestingThreadPoolIfc, Closeable,
     }
 
     @Override
-    public void setMaximumNumberOfThreads(int activeCount) {
+    public void setMaximumNumberOfThreads(final int activeCount) {
         checkArgument(activeCount > 0);
         executorService.setMaximumPoolSize(activeCount);
     }
-
 }